From a055d8ddf95f243bf33bc675f694102e3d32c0e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20H=C3=A4rtl?= Date: Thu, 28 Nov 2019 14:51:54 +0100 Subject: [PATCH] Always return overwritehost if configured MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/AppFramework/Http/Request.php | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.39.5