]> source.dussan.org Git - nextcloud-server.git/commitdiff
Always return overwritehost if configured 18151/head
authorJulius Härtl <jus@bitgrid.net>
Thu, 28 Nov 2019 13:51:54 +0000 (14:51 +0100)
committerJulius Härtl <jus@bitgrid.net>
Thu, 28 Nov 2019 14:02:33 +0000 (15:02 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/AppFramework/Http/Request.php

index 587178e8eded74374fa85dc1ea7d6edfc2ea9cdd..9d210cd8419c1fc9c0f96de47cc7b0c4df89a8a6 100644 (file)
@@ -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;
        }