Skip to content

Commit

Permalink
Merge pull request #29000 from nextcloud/backport/28995/stable20
Browse files Browse the repository at this point in the history
[stable20] Fix redirect during initial setup
  • Loading branch information
szaimen authored Sep 29, 2021
2 parents d63f6d8 + 072d4bb commit 7303c09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/URLGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7303c09

Please sign in to comment.