mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Respect X-Forwarded-Proto header in UrlManager (closes #54)
This commit is contained in:
parent
905fc0f357
commit
27daf384da
@ -32,6 +32,11 @@ class UrlManager
|
||||
|
||||
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]";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user