Skip to content

Commit

Permalink
Add back force https (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy132 authored Nov 26, 2024
1 parent d2d960e commit ad9447e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit ad9447e

Please sign in to comment.