From 97a0e630e9d33a3bedf598b3c7d5323773d74927 Mon Sep 17 00:00:00 2001 From: Pedro Cunha Date: Fri, 29 Nov 2024 00:10:32 +0000 Subject: [PATCH] feat: trust 10.0.0.0/8 by default for TrustProxies --- bootstrap/app.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bootstrap/app.php b/bootstrap/app.php index 696386de..c4fd8aff 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -4,6 +4,7 @@ use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; +use Symfony\Component\HttpFoundation\Request; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( @@ -28,6 +29,10 @@ 'solder_mods' => \App\Http\Middleware\SolderMods::class, 'solder_users' => \App\Http\Middleware\SolderUsers::class, ]); + + $middleware->trustProxies(at: [ + '10.0.0.0/8', + ], headers: Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PROTO); }) ->withExceptions(function (Exceptions $exceptions) { //