Force https on URLs when behind proxy; closes #3623
This commit is contained in:
parent
60b82343b2
commit
0a4ba6a7dc
1 changed files with 11 additions and 0 deletions
|
@ -4,9 +4,11 @@ namespace Pterodactyl\Providers;
|
|||
|
||||
use View;
|
||||
use Cache;
|
||||
use Illuminate\Support\Str;
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Pterodactyl\Models\Subuser;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
@ -32,6 +34,15 @@ class AppServiceProvider extends ServiceProvider
|
|||
View::share('appIsGit', $this->versionData()['is_git'] ?? false);
|
||||
|
||||
Paginator::useBootstrap();
|
||||
|
||||
// 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.
|
||||
//
|
||||
// @see https://github.com/pterodactyl/panel/issues/3623
|
||||
if (Str::startsWith(config('app.url') ?? '', 'https://')) {
|
||||
URL::forceScheme('https');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue