diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-11-28 14:51:54 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-11-28 15:02:33 +0100 |
commit | a055d8ddf95f243bf33bc675f694102e3d32c0e5 (patch) | |
tree | fb3eea2ac2989b1f32131599962f0293f4713d62 /lib | |
parent | 6b97f6af48ba8dc029e616cf778a1cbcd0fea001 (diff) | |
download | nextcloud-server-a055d8ddf95f243bf33bc675f694102e3d32c0e5.tar.gz nextcloud-server-a055d8ddf95f243bf33bc675f694102e3d32c0e5.zip |
Always return overwritehost if configured
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-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; } |