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:46 +0300
committerGitHub <noreply@github.com>2021-09-29 19:55:46 +0300
commit115ae9814240a3aad4aa7446aaebef5436b4526b (patch)
tree4fbd2c6f3c7eec95d1dea9c5ebcc274b8fb6b677
parent610bc603c80499b9670a18f52fc380df8a47897a (diff)
parent33685c58de32ddf5e33c4ee0d4dedcb1fd44051b (diff)
Merge pull request #28998 from nextcloud/backport/28995/stable22
[stable22] 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;