changement headers
This commit is contained in:
@@ -21,18 +21,11 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
// Reconnaître les headers du reverse proxy
|
||||
SymfonyRequest::setTrustedProxies(
|
||||
['*'],
|
||||
SymfonyRequest::HEADER_X_FORWARDED_FOR |
|
||||
SymfonyRequest::HEADER_X_FORWARDED_HOST |
|
||||
SymfonyRequest::HEADER_X_FORWARDED_PROTO |
|
||||
SymfonyRequest::HEADER_X_FORWARDED_PORT
|
||||
);
|
||||
|
||||
// Forcer HTTPS en production et staging (pas en local)
|
||||
// Forcer HTTPS absolument en production (peu importe le proxy)
|
||||
if (!app()->environment('local')) {
|
||||
URL::forceScheme('https');
|
||||
// Accepter les headers du reverse proxy
|
||||
SymfonyRequest::setTrustedProxies(['*'], -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user