diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-03-28 11:55:48 +0300 |
---|---|---|
committer | Stefan Giehl <stefan@matomo.org> | 2019-03-28 11:55:48 +0300 |
commit | f6908294d00093234b2a27342f8f32b13a2b2232 (patch) | |
tree | 2ec39dd44d4ee0c178a4e694297d9dedba02a5a9 | |
parent | 4d6d98b9ca85c067a94d313f0b2a659bc1575940 (diff) |
Consistent detection of HTTPS (#14185)
see https://github.com/matomo-org/matomo/blob/3.9.0-b3/core/ProxyHeaders.php#L22-L40 where we recognise these headers already
-rw-r--r-- | core/Url.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/Url.php b/core/Url.php index 310249b89c..57bf0512aa 100644 --- a/core/Url.php +++ b/core/Url.php @@ -727,6 +727,14 @@ class Url */ protected static function getCurrentSchemeFromRequestHeader() { + if (isset($_SERVER['HTTP_X_FORWARDED_SCHEME']) && strtolower($_SERVER['HTTP_X_FORWARDED_SCHEME']) === 'https') { + return 'https'; + } + + if (isset($_SERVER['HTTP_X_URL_SCHEME']) && strtolower($_SERVER['HTTP_X_URL_SCHEME']) === 'https') { + return 'https'; + } + if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'http') { return 'http'; } |