From 4690192a71f8b720d463fc7c29b6dd84d8145add Mon Sep 17 00:00:00 2001 From: Dario Rekowski on RockPI Date: Wed, 14 Apr 2021 10:04:17 +0000 Subject: [PATCH] update config for working with tests --- community_server/config/bootstrap.php | 2 +- community_server/config/routes.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/community_server/config/bootstrap.php b/community_server/config/bootstrap.php index 55918ba20..77264ee0a 100644 --- a/community_server/config/bootstrap.php +++ b/community_server/config/bootstrap.php @@ -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); } diff --git a/community_server/config/routes.php b/community_server/config/routes.php index 5a537b9c2..322825c87 100644 --- a/community_server/config/routes.php +++ b/community_server/config/routes.php @@ -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');