From 31363b701650a5939383383a9cd4efc7f8864d74 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Mon, 10 May 2021 20:06:48 +0200 Subject: [PATCH 1/2] add ipv6 for localhost check --- community_server/config/routes.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 = []; From 2f23d64e613102cb1412bad3fd10fd7cbf76f2db Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Tue, 25 May 2021 14:39:32 +0200 Subject: [PATCH 2/2] Update routes.php --- community_server/config/routes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community_server/config/routes.php b/community_server/config/routes.php index da9118f65..3b0dfedc1 100644 --- a/community_server/config/routes.php +++ b/community_server/config/routes.php @@ -66,7 +66,7 @@ Router::scope('/', function (RouteBuilder $routes) { return true; } $allowedIpLocalhost = ['127.0.0.1', 'localhost', '', '::1']; - if(true == in_array($clientIp, $allowedIpLocalhost)) { + if(in_array($clientIp, $allowedIpLocalhost)) { return true; } $allowedCaller = Configure::read('API.allowedCaller');