summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszaimen <szaimen@e.mail.de>2021-09-29 17:35:53 +0200
committerGitHub <noreply@github.com>2021-09-29 17:35:53 +0200
commit75b3263e80bc7509a19192a88fc3774f6a829885 (patch)
treeab04c6653eda2242b6946c41373a88e3314500a9
parent5a469f54ab6877b690d585517186bb5fcf40546b (diff)
parent18d32a1ce70f092fe83af07da4fe0038e3fe2a7f (diff)
downloadnextcloud-server-75b3263e80bc7509a19192a88fc3774f6a829885.tar.gz
nextcloud-server-75b3263e80bc7509a19192a88fc3774f6a829885.zip
Merge pull request #28995 from nextcloud/fix/initial_setup_redirect
Fix redirect during initial setup
-rw-r--r--lib/private/URLGenerator.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php
index f7fa6fa5632..511c37d2624 100644
--- a/lib/private/URLGenerator.php
+++ b/lib/private/URLGenerator.php
@@ -271,7 +271,8 @@ class URLGenerator implements IURLGenerator {
* @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;