Support X-Forwarded-Proto header (#12759)

This commit is contained in:
Jellyfrog
2021-04-23 05:21:01 +02:00
committed by GitHub
parent 53d46044c3
commit d9ac9ab80d

View File

@@ -404,7 +404,10 @@ class Config
private static function processConfig()
{
// If we're on SSL, let's properly detect it
if (isset($_SERVER['HTTPS'])) {
if (
isset($_SERVER['HTTPS']) ||
(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
) {
self::set('base_url', preg_replace('/^http:/', 'https:', self::get('base_url')));
}