From 8f12d924625c476f7e10ae477ac1c674671bbbbd Mon Sep 17 00:00:00 2001 From: Boy132 Date: Mon, 25 Nov 2024 22:33:19 +0100 Subject: [PATCH] add back force https --- app/Providers/AppServiceProvider.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 059c22a113..9c719021cd 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -16,7 +16,9 @@ use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Http; +use Illuminate\Support\Facades\URL; use Illuminate\Support\ServiceProvider; +use Illuminate\Support\Str; use Laravel\Sanctum\Sanctum; use SocialiteProviders\Discord\Provider; use SocialiteProviders\Manager\SocialiteWasCalled; @@ -28,6 +30,11 @@ class AppServiceProvider extends ServiceProvider */ public function boot(Application $app): void { + // If the APP_URL value is set with https:// make sure we force it here. Theoretically + // this should just work with the proxy logic, but there are a lot of cases where it + // doesn't, and it triggers a lot of support requests, so lets just head it off here. + URL::forceHttps(Str::startsWith(config('app.url') ?? '', 'https://')); + Relation::enforceMorphMap([ 'allocation' => Models\Allocation::class, 'api_key' => Models\ApiKey::class,