mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 20:26:42 +00:00
Respect X-Forwarded-Proto header in UrlManager (closes #54)
This commit is contained in:
@@ -32,6 +32,11 @@ class UrlManager
|
|||||||
|
|
||||||
private function GetBaseUrl()
|
private function GetBaseUrl()
|
||||||
{
|
{
|
||||||
|
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
|
||||||
|
{
|
||||||
|
$_SERVER['HTTPS'] = 'on';
|
||||||
|
}
|
||||||
|
|
||||||
return (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
|
return (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user