Add a switch to force 'assume SSL' mode behind a reverse proxy, when the RP adds SSL and the internal connection is HTTP only.

This commit is contained in:
Thomas Göttgens 2020-07-20 14:03:55 +02:00
parent cf84f82eae
commit 546980249e
3 changed files with 4 additions and 1 deletions

View file

@ -31,6 +31,7 @@ class Application_Common_HTTPHelper
$baseUrl = $CC_CONFIG['baseUrl'];
$baseDir = $CC_CONFIG['baseDir'];
$basePort = $CC_CONFIG['basePort'];
$forceSSL = $CC_CONFIG['forceSSL'];
if (empty($baseDir)) {
$baseDir = "/";
}
@ -42,7 +43,7 @@ class Application_Common_HTTPHelper
}
$scheme = "http";
if ($secured && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
if ($forceSSL || ($secured && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')) {
$scheme = "https";
$basePort = "443"; //Airtime Pro compatibility hack
}