diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index eb9ef4e52b462..dce5f927e60c0 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -271,7 +271,8 @@ public function linkToDocs(string $key): string { * @return string base url of the current request */ public function getBaseUrl(): string { - if ($this->baseUrl === null) { + // BaseUrl can be equal to 'http(s)://' during the first steps of the intial setup. + if ($this->baseUrl === null || $this->baseUrl === "http://" || $this->baseUrl === "https://") { $this->baseUrl = $this->request->getServerProtocol() . '://' . $this->request->getServerHost() . \OC::$WEBROOT; } return $this->baseUrl;