mirror of https://github.com/Rudloff/alltube.git
Provide support X-Forwarded-Host header
This commit is contained in:
parent
086fb93a3a
commit
32d181298c
|
@ -39,6 +39,12 @@ class ViewFactory
|
|||
$uri = $uri->withScheme('https')->withPort(443);
|
||||
}
|
||||
|
||||
// set values from X-Forwarded-* headers
|
||||
$host = current($request->getHeader('X-Forwarded-Host'));
|
||||
if ($host) {
|
||||
$uri = $uri->withHost($host);
|
||||
}
|
||||
|
||||
$port = current($request->getHeader('X-Forwarded-Port'));
|
||||
if ($port) {
|
||||
$uri = $uri->withPort(intVal($port));
|
||||
|
|
Loading…
Reference in New Issue