* check X-Forwarded-Proto for https

This commit is contained in:
maxpozdeev 2023-08-06 17:05:25 +03:00
parent cf39163d7b
commit 778a4e5fa8

View file

@ -376,12 +376,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;
}