Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-01-28 13:38:31 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2021-01-28 13:38:31 +0300
commitba42ed33eade812d8a372487a5544cee135ee0a4 (patch)
tree9a7a6a58231a9e83ba217c42495f5e4040696d81 /lib
parentadd40f28369d1a8daf9c1185567a9c31239ce733 (diff)
Use https by default for the federation service
If no protocol is set we assume https. (everybody should use that anyway) Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/FederationService.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Service/FederationService.php b/lib/Service/FederationService.php
index ed6eb434..e20a20a9 100644
--- a/lib/Service/FederationService.php
+++ b/lib/Service/FederationService.php
@@ -70,6 +70,11 @@ class FederationService {
* @throws \Exception
*/
public function getRemoteCollaboraURL($remote) {
+ // If no protocol is provided we default to https
+ if (strpos($remote, 'http://') !== 0 && strpos($remote, 'https://') !== 0) {
+ $remote = 'https://' . $remote;
+ }
+
if (!$this->isTrustedRemote($remote)) {
throw new \Exception('Unable to determine collabora URL of remote server ' . $remote . ' - Remote is not a trusted server');
}