Skip to content

Commit 7303c09

Browse files
authored
Merge pull request #29000 from nextcloud/backport/28995/stable20
[stable20] Fix redirect during initial setup
2 parents d63f6d8 + 072d4bb commit 7303c09

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/private/URLGenerator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ public function linkToDocs(string $key): string {
271271
* @return string base url of the current request
272272
*/
273273
public function getBaseUrl(): string {
274-
if ($this->baseUrl === null) {
274+
// BaseUrl can be equal to 'http(s)://' during the first steps of the intial setup.
275+
if ($this->baseUrl === null || $this->baseUrl === "http://" || $this->baseUrl === "https://") {
275276
$this->baseUrl = $this->request->getServerProtocol() . '://' . $this->request->getServerHost() . \OC::$WEBROOT;
276277
}
277278
return $this->baseUrl;

0 commit comments

Comments
 (0)