Merge pull request #28998 from nextcloud/backport/28995/stable22

[stable22] Fix redirect during initial setup
This commit is contained in:
szaimen 2021-09-29 18:55:46 +02:00 committed by GitHub
commit 115ae98142
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;