fix: detect HTTPS from APP_URL instead of APP_ENV
Triggers URL force scheme and proxy trust whenever APP_URL starts with https://, regardless of APP_ENV value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,9 +24,15 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
Vite::prefetch(concurrency: 3);
|
Vite::prefetch(concurrency: 3);
|
||||||
|
|
||||||
if (config('app.env') === 'production') {
|
if (str_starts_with(config('app.url', ''), 'https://')) {
|
||||||
URL::forceScheme('https');
|
URL::forceScheme('https');
|
||||||
Request::setTrustedProxies(['*'], Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);
|
Request::setTrustedProxies(
|
||||||
|
['*'],
|
||||||
|
Request::HEADER_X_FORWARDED_FOR |
|
||||||
|
Request::HEADER_X_FORWARDED_HOST |
|
||||||
|
Request::HEADER_X_FORWARDED_PORT |
|
||||||
|
Request::HEADER_X_FORWARDED_PROTO
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user