Merge pull request #18151 from nextcloud/bugfix/noid/overwrite-host-proxy
Always return overwritehost if configured
This commit is contained in:
commit
1e91b6a716
|
@ -853,6 +853,10 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @return string Server host
|
||||
*/
|
||||
public function getInsecureServerHost(): string {
|
||||
if ($this->fromTrustedProxy() && $this->getOverwriteHost() !== null) {
|
||||
return $this->getOverwriteHost();
|
||||
}
|
||||
|
||||
$host = 'localhost';
|
||||
if ($this->fromTrustedProxy() && isset($this->server['HTTP_X_FORWARDED_HOST'])) {
|
||||
if (strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) {
|
||||
|
@ -868,6 +872,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
$host = $this->server['SERVER_NAME'];
|
||||
}
|
||||
}
|
||||
|
||||
return $host;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue