diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-12-03 09:48:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-03 09:48:19 +0300 |
commit | 1e91b6a716ab85f402e4b9dbdb4107ff133e1597 (patch) | |
tree | 05bd0502faeb706acb1117477d24858d9d69e6d7 /lib/private | |
parent | 4cbaf69bc31e233942c41e2ee6612c3cdbb6cddf (diff) | |
parent | a055d8ddf95f243bf33bc675f694102e3d32c0e5 (diff) |
Merge pull request #18151 from nextcloud/bugfix/noid/overwrite-host-proxy
Always return overwritehost if configured
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/AppFramework/Http/Request.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 587178e8ede..9d210cd8419 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -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; } |