[FIX] 修正 HTTPS 強制跳轉邏輯,依據 APP_URL 配置自動啟用 HTTPS 防止安全啟動警告
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 43s
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 43s
This commit is contained in:
@@ -22,7 +22,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
if (!$this->app->isLocal()) {
|
||||
if (str_starts_with(config('app.url'), 'https://')) {
|
||||
\Illuminate\Support\Facades\URL::forceScheme('https');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user