Skip to content

Commit 90616ae

Browse files
committed
fix: do not get remote collabora url for own server
if you connect from your own server and it is also listed as a trusted federation domain, there is no need to fetch the remote collabora url, as it is the one already configured internally Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
1 parent f5cedcd commit 90616ae

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/Service/FederationService.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ public function getRemoteCollaboraURL($remote) {
7373
if (!$this->isTrustedRemote($remote)) {
7474
throw new \Exception('Unable to determine collabora URL of remote server ' . $remote . ' - Remote is not a trusted server');
7575
}
76+
77+
$serverProtocol = $this->request->getServerProtocol() . '://';
78+
$serverHost = $this->request->getServerHost();
79+
$server = $serverProtocol . $serverHost . $this->request->getRequestUri();
80+
if (str_starts_with($server, $remote)) {
81+
return $this->appConfig->getCollaboraUrlInternal();
82+
}
83+
7684
$remoteCollabora = $this->cache->get('richdocuments_remote/' . $remote);
7785
if ($remoteCollabora !== null) {
7886
return $remoteCollabora;

0 commit comments

Comments
 (0)