Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
cache baseurl in url generator
Servers don't tend to change their url in the middle of a request

Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and backportbot[bot] committed Mar 10, 2021
commit 0fb70a36ee2e5f33d57c714e82c71698622728c3
5 changes: 4 additions & 1 deletion lib/private/URLGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ public function linkToDocs(string $key): string {
* @return string base url of the current request
*/
public function getBaseUrl(): string {
return $this->request->getServerProtocol() . '://' . $this->request->getServerHost() . \OC::$WEBROOT;
if ($this->baseUrl === null) {
$this->baseUrl = $this->request->getServerProtocol() . '://' . $this->request->getServerHost() . \OC::$WEBROOT;
}
return $this->baseUrl;
}
}