Skip to content

Commit

Permalink
fixup! Only expose link to info endpoint in capabilties
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr committed Nov 27, 2019
1 parent 9588893 commit 5061da1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/files/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use OCP\DirectEditing\RegisterDirectEditorEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IURLGenerator;

/**
* Class Capabilities
Expand All @@ -48,14 +49,18 @@ class Capabilities implements ICapability {
/** @var DirectEditingService */
protected $directEditingService;

/** @var IURLGenerator */
private $urlGenerator;

/**
* Capabilities constructor.
*
* @param IConfig $config
*/
public function __construct(IConfig $config, DirectEditingService $directEditingService) {
public function __construct(IConfig $config, DirectEditingService $directEditingService, IURLGenerator $urlGenerator) {
$this->config = $config;
$this->directEditingService = $directEditingService;
$this->urlGenerator = $urlGenerator;
}

/**
Expand All @@ -69,7 +74,7 @@ public function getCapabilities() {
'bigfilechunking' => true,
'blacklisted_files' => $this->config->getSystemValue('blacklisted_files', ['.htaccess']),
'directEditing' => [
'url' => \OC::$server->getURLGenerator()->linkToOCSRouteAbsolute('files.DirectEditing.info'),
'url' => $this->urlGenerator->linkToOCSRouteAbsolute('files.DirectEditing.info'),
'etag' => $this->directEditingService->getDirectEditingETag()
]
],
Expand Down

0 comments on commit 5061da1

Please sign in to comment.