add config check

This commit is contained in:
Dario Rekowski on RockPI 2020-05-12 09:56:53 +00:00
parent 61b520fdef
commit e0aa06744e
2 changed files with 8 additions and 6 deletions

View File

@ -67,6 +67,7 @@ Router::scope('/', function (RouteBuilder $routes) {
return true; return true;
} }
$allowedCaller = Configure::read('API.allowedCaller'); $allowedCaller = Configure::read('API.allowedCaller');
if($allowedCaller && count($allowedCaller) > 0) {
$callerIp = $request->clientIp(); $callerIp = $request->clientIp();
foreach($allowedCaller as $allowed) { foreach($allowedCaller as $allowed) {
$ip = gethostbyname($allowed); $ip = gethostbyname($allowed);
@ -74,6 +75,7 @@ Router::scope('/', function (RouteBuilder $routes) {
} }
} }
} }
}
}); });
// Register scoped middleware for in scopes. // Register scoped middleware for in scopes.

@ -1 +1 @@
Subproject commit a04d4769974b9d93ba72e490ed7dca3fbaed768c Subproject commit 21d4a0a5e9a19f251e26c0ae07ce74be2fa99bbf