diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2016-07-14 04:46:33 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2016-07-14 04:46:33 +0300 |
commit | e2baedc4f8e20df5f9ccf78d465e1c95bb9efa98 (patch) | |
tree | 8809cbb78710e4072c121aa8f85960790ef0bb84 /core/Url.php | |
parent | 7b7df7441774ee1989633bb7b3112e0294f921aa (diff) |
make sure we prefer forwarded proto header over regular header (#10081)
Diffstat (limited to 'core/Url.php')
-rw-r--r-- | core/Url.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/Url.php b/core/Url.php index 2a301a9b46..a0d480da33 100644 --- a/core/Url.php +++ b/core/Url.php @@ -711,6 +711,10 @@ class Url */ protected static function getCurrentSchemeFromRequestHeader() { + if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'http') { + return 'http'; + } + if ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] === true)) || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ) { |