Skip to content

Commit

Permalink
Merge pull request nextcloud#28998 from nextcloud/backport/28995/stab…
Browse files Browse the repository at this point in the history
…le22

[stable22] Fix redirect during initial setup
  • Loading branch information
szaimen authored Sep 29, 2021
2 parents 610bc60 + 33685c5 commit 115ae98
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 115ae98

Please sign in to comment.