Always return overwritehost if configured
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
6b97f6af48
commit
a055d8ddf9
|
@ -853,6 +853,10 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
||||||
* @return string Server host
|
* @return string Server host
|
||||||
*/
|
*/
|
||||||
public function getInsecureServerHost(): string {
|
public function getInsecureServerHost(): string {
|
||||||
|
if ($this->fromTrustedProxy() && $this->getOverwriteHost() !== null) {
|
||||||
|
return $this->getOverwriteHost();
|
||||||
|
}
|
||||||
|
|
||||||
$host = 'localhost';
|
$host = 'localhost';
|
||||||
if ($this->fromTrustedProxy() && isset($this->server['HTTP_X_FORWARDED_HOST'])) {
|
if ($this->fromTrustedProxy() && isset($this->server['HTTP_X_FORWARDED_HOST'])) {
|
||||||
if (strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) {
|
if (strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) {
|
||||||
|
@ -868,6 +872,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
||||||
$host = $this->server['SERVER_NAME'];
|
$host = $this->server['SERVER_NAME'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $host;
|
return $host;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue