From 31363b701650a5939383383a9cd4efc7f8864d74 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Mon, 10 May 2021 20:06:48 +0200 Subject: [PATCH] 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 = [];