diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index b432b0b69cad4..018361e0062e3 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -267,6 +267,9 @@ public function linkToDocs(string $key): string { * @return string base url of the current request */ public function getBaseUrl(): string { - return $this->request->getServerProtocol() . '://' . $this->request->getServerHost() . \OC::$WEBROOT; + if ($this->baseUrl === null) { + $this->baseUrl = $this->request->getServerProtocol() . '://' . $this->request->getServerHost() . \OC::$WEBROOT; + } + return $this->baseUrl; } }