From f7db5a6821740b88dc27396c678ba503b3546b2a Mon Sep 17 00:00:00 2001 From: Henrik Steen Date: Thu, 11 Jul 2024 00:53:10 +0200 Subject: [PATCH] Force https --- backend/app/Providers/AppServiceProvider.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/app/Providers/AppServiceProvider.php b/backend/app/Providers/AppServiceProvider.php index 452e6b65..e29439f1 100644 --- a/backend/app/Providers/AppServiceProvider.php +++ b/backend/app/Providers/AppServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use Illuminate\Support\Facades\URL; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider @@ -19,6 +20,8 @@ public function register(): void */ public function boot(): void { - // + if ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { + URL::forceScheme('https'); + } } }