Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorszaimen <szaimen@e.mail.de>2021-09-29 19:55:26 +0300
committerGitHub <noreply@github.com>2021-09-29 19:55:26 +0300
commit7303c09de0baa41ba36ee532f842a53906b9d3f8 (patch)
tree2fc965a8078562e04f287c6b2eec3cd906fd6161
parentd63f6d8c18b01028910ac9d1a2e43e290d90338b (diff)
parent072d4bb0d08627ff31f176fc8318fe2a12ef24a3 (diff)
Merge pull request #29000 from nextcloud/backport/28995/stable20
[stable20] 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 eb9ef4e52b4..dce5f927e60 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;