Skip to content

Commit

Permalink
fix: set replace_ip default to false (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Mar 30, 2024
1 parent 1ba3645 commit 5d18e60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/laravelcloudflare.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
|
*/

'replace_ip' => (bool) env('LARAVEL_CLOUDFLARE_REPLACE_IP', true),
'replace_ip' => (bool) env('LARAVEL_CLOUDFLARE_REPLACE_IP', false),

/*
|--------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Http/Middleware/TrustProxiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 5d18e60

Please sign in to comment.