Merge pull request #466 from gradido/community_ipv6_localhost

Community ipv6 localhost
This commit is contained in:
einhornimmond 2021-05-25 15:19:31 +02:00 committed by GitHub
commit 425d01263a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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(in_array($clientIp, $allowedIpLocalhost)) {
return true;
}
$allowedCaller = Configure::read('API.allowedCaller');
$ipPerHost = [];