diff --git a/config/laravelcloudflare.php b/config/laravelcloudflare.php index ee9e366..e4c04c9 100644 --- a/config/laravelcloudflare.php +++ b/config/laravelcloudflare.php @@ -23,7 +23,7 @@ | */ - 'replace_ip' => (bool) env('LARAVEL_CLOUDFLARE_REPLACE_IP', true), + 'replace_ip' => (bool) env('LARAVEL_CLOUDFLARE_REPLACE_IP', false), /* |-------------------------------------------------------------------------- diff --git a/tests/Unit/Http/Middleware/TrustProxiesTest.php b/tests/Unit/Http/Middleware/TrustProxiesTest.php index 092b20f..9cab758 100644 --- a/tests/Unit/Http/Middleware/TrustProxiesTest.php +++ b/tests/Unit/Http/Middleware/TrustProxiesTest.php @@ -4,7 +4,6 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; -use Illuminate\Support\Facades\Route; use Monicahq\Cloudflare\Http\Middleware\TrustProxies; use Monicahq\Cloudflare\LaravelCloudflare; use Monicahq\Cloudflare\Tests\FeatureTestCase; @@ -83,6 +82,8 @@ public function it_deactivates_middleware() /** @test */ public function it_sets_remote_addr() { + config(['laravelcloudflare.replace_ip' => true]); + $request = new Request(); $request->server->set('REMOTE_ADDR', '127.0.0.1'); $request->headers->set('Cf-Connecting-Ip', '127.0.1.1');