1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Fixes for trusted proxies

This commit is contained in:
David Bomba 2021-12-03 12:36:21 +11:00
parent 2d243be4ae
commit 35d5f532bc

View File

@ -38,9 +38,9 @@ class StartupCheck
// set TRUSTED_PROXIES=* if you want to trust every proxy.
if (isset($_ENV['TRUSTED_PROXIES'])) {
if (env('TRUSTED_PROXIES') == '*') {
$request->setTrustedProxies(['127.0.0.1', $request->server->get('REMOTE_ADDR')]);
$request->setTrustedProxies(['127.0.0.1', $request->server->get('REMOTE_ADDR')],Request::HEADER_X_FORWARDED_ALL);
} else{
$request->setTrustedProxies(array_map('trim', explode(',', env('TRUSTED_PROXIES'))));
$request->setTrustedProxies(array_map('trim', explode(',', env('TRUSTED_PROXIES'))),Request::HEADER_X_FORWARDED_ALL);
}
}