Skip to content

Commit

Permalink
- add trust proxies middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
mtracz committed Mar 28, 2024
1 parent 7e53127 commit 36555c2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Middleware;
use Symfony\Component\HttpFoundation\Request;
use Toby\Http\Middleware\HandleInertiaRequests;
use Toby\Http\Middleware\RedirectIfAuthenticated;

Expand All @@ -18,6 +19,14 @@
$middleware->alias([
"guest" => RedirectIfAuthenticated::class,
]);
$middleware->trustProxies(
at: "*",
headers: Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB,
);
})
->withExceptions()
->create();

0 comments on commit 36555c2

Please sign in to comment.