add ipv6 for localhost check

This commit is contained in:
einhornimmond 2021-05-10 20:06:48 +02:00
parent 98655a2703
commit 31363b7016

View File

@ -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 = [];