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:
authorJulius Härtl <jus@bitgrid.net>2021-04-30 14:06:07 +0300
committerJulius Härtl <jus@bitgrid.net>2021-04-30 14:06:07 +0300
commit8f9cad639e119528abdb152018db475c36d15fda (patch)
tree7be1fc74e867b0425cb4df64b5534e785d54ba68 /lib
parent90ed39acab30b5e077a139b7949a98b2b674c5f7 (diff)
Use proper initiator url
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/FederationService.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Service/FederationService.php b/lib/Service/FederationService.php
index 190c9c1e..f8d3e5f7 100644
--- a/lib/Service/FederationService.php
+++ b/lib/Service/FederationService.php
@@ -41,6 +41,7 @@ use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\ILogger;
use OCP\IRequest;
+use OCP\IURLGenerator;
use OCP\Share\IShare;
class FederationService {
@@ -59,14 +60,17 @@ class FederationService {
private $tokenManager;
/** @var IRequest */
private $request;
+ /** @var IURLGenerator */
+ private $urlGenerator;
- public function __construct(ICacheFactory $cacheFactory, IClientService $clientService, ILogger $logger, TokenManager $tokenManager, IConfig $config, IRequest $request) {
+ public function __construct(ICacheFactory $cacheFactory, IClientService $clientService, ILogger $logger, TokenManager $tokenManager, IConfig $config, IRequest $request, IURLGenerator $urlGenerator) {
$this->cache = $cacheFactory->createDistributed('richdocuments_remote/');
$this->clientService = $clientService;
$this->logger = $logger;
$this->tokenManager = $tokenManager;
$this->config = $config;
$this->request = $request;
+ $this->urlGenerator = $urlGenerator;
try {
$this->trustedServers = \OC::$server->query( \OCA\Federation\TrustedServers::class);
} catch (QueryException $e) {}
@@ -202,7 +206,7 @@ class FederationService {
$shareToken = $share ? $share->getToken() : null;
$wopi = $this->tokenManager->newInitiatorToken($remote, $item, $shareToken, ($direct !== null), ($direct ? $direct->getUid() : null));
- $initiatorServer = $wopi->getServerHost();
+ $initiatorServer = $this->urlGenerator->getAbsoluteURL('/');
$initiatorToken = $wopi->getToken();
/**