diff --git a/community_server/config/routes.php b/community_server/config/routes.php index 322825c87..da9118f65 100644 --- a/community_server/config/routes.php +++ b/community_server/config/routes.php @@ -65,8 +65,9 @@ Router::scope('/', function (RouteBuilder $routes) { if($entry == 'ElopageWebhook' || $entry == 'AppRequests') { return true; } - if($request->clientIp() == '127.0.0.1' || $request->clientIp() == 'localhost' || $request->clientIp() == '') { - return true; + $allowedIpLocalhost = ['127.0.0.1', 'localhost', '', '::1']; + if(true == in_array($clientIp, $allowedIpLocalhost)) { + return true; } $allowedCaller = Configure::read('API.allowedCaller'); $ipPerHost = [];