update config for working with tests

This commit is contained in:
Dario Rekowski on RockPI 2021-04-14 10:04:17 +00:00
parent 57144956b5
commit 4690192a71
2 changed files with 2 additions and 2 deletions

View File

@ -197,7 +197,7 @@ Type::build('timestamp')
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, PUT, PATCH, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: *');
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
exit(0);
}

View File

@ -65,7 +65,7 @@ Router::scope('/', function (RouteBuilder $routes) {
if($entry == 'ElopageWebhook' || $entry == 'AppRequests') {
return true;
}
if($request->clientIp() == '127.0.0.1' || $request->clientIp() == 'localhost') {
if($request->clientIp() == '127.0.0.1' || $request->clientIp() == 'localhost' || $request->clientIp() == '') {
return true;
}
$allowedCaller = Configure::read('API.allowedCaller');