We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d81afc commit 41552a1Copy full SHA for 41552a1
1 file changed
src/Helper/RoundcubeHelper.php
@@ -19,8 +19,11 @@ public static function getSiteUrl(): string
19
return $url;
20
}
21
22
- $scheme = filter_var($_SERVER['HTTPS'] ?? 'off', \FILTER_VALIDATE_BOOLEAN) ? 'https' : 'http';
23
- $requestedUrl = "{$scheme}://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
+ $host = $_SERVER['HTTP_X_FORWARDED_HOST'] ?? $_SERVER['HTTP_HOST'];
+ $scheme = $_SERVER['HTTP_X_FORWARDED_PROTO'] ?? (
24
+ filter_var($_SERVER['HTTPS'] ?? 'off', \FILTER_VALIDATE_BOOLEAN) ? 'https' : 'http'
25
+ );
26
+ $requestedUrl = "{$scheme}://{$host}{$_SERVER['REQUEST_URI']}";
27
$parts = parse_url($requestedUrl);
28
29
// remove potential trailing index.php
0 commit comments