From 319d27ed87a5a816b1415076226f953ff29586f5 Mon Sep 17 00:00:00 2001 From: Benjamin Gaussorgues Date: Thu, 24 Aug 2023 16:13:45 +0200 Subject: [PATCH] REMOVE ME: temporary fix to allow both routes on same endpoint --- lib/Controller/V1/MetaDataController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Controller/V1/MetaDataController.php b/lib/Controller/V1/MetaDataController.php index d262a2b7..f5de3156 100644 --- a/lib/Controller/V1/MetaDataController.php +++ b/lib/Controller/V1/MetaDataController.php @@ -130,6 +130,12 @@ public function setMetaData(int $id, string $metaData): DataResponse { public function updateMetaData(int $id, string $metaData): DataResponse { $e2eToken = $this->request->getParam('e2e-token'); + // FIXME Temporary fix to handle both routes on single endpoint + if (empty($e2eToken)) { + $e2eToken = $this->request->getHeader('e2e-token'); + } + // End + if ($this->lockManager->isLocked($id, $e2eToken)) { throw new OCSForbiddenException($this->l10n->t('You are not allowed to edit the file, make sure to first lock it, and then send the right token')); }