mirror of
https://github.com/grocy/grocy.git
synced 2026-04-04 20:06:16 +02: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()
|
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]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user