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

Fix to show real IP when using CloudFlare

This commit is contained in:
Hillel Coren 2016-11-22 20:46:40 +02:00
parent d891aaedef
commit c0679cf197

View File

@ -65,4 +65,9 @@ $app->configureMonologUsing(function($monolog) {
$monolog->pushHandler(new Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-error.log', Monolog\Logger::ERROR, false));
});
// Capture real IP if using cloudflare
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
}
return $app;