Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
markvaneijk committed Dec 1, 2023
1 parent 2cb5997 commit 5e18486
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Middleware/TrustCloudflareProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ class TrustCloudflareProxies
public function handle(Request $request, Closure $next)
{
$request->setTrustedProxies(
$this->getCachedProxies(),
Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_PREFIX | Request::HEADER_X_FORWARDED_AWS_ELB
$this->getCachedProxies()
);

if (! app()->isLocal() && ! $request->secure()) {
return redirect()->secure($request->path());
}

return $next($request);
}

Expand Down

0 comments on commit 5e18486

Please sign in to comment.