* check X-Forwarded-Proto for https

(cherry picked from commit 778a4e5fa8)
This commit is contained in:
maxpozdeev 2023-08-06 17:05:25 +03:00
parent f19573221a
commit 3e5252e931

View file

@ -409,12 +409,13 @@ function is_https(): bool
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
return true;
}
/*
TODO: Check for X-Forwarded-Proto==https or X-Forwarded-For==https ?
*/
if (defined('MTT_USE_HTTPS') && MTT_USE_HTTPS) {
return true;
}
// This HTTP header can be overriden by user agent!
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') {
return true;
}
return false;
}