Provide support X-Forwarded-Host header

This commit is contained in:
bellington3 2020-10-18 18:11:02 +02:00
parent 086fb93a3a
commit 32d181298c
1 changed files with 6 additions and 0 deletions

View File

@ -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));