From 2b8ad9f9a842546c653f0e2f0c26ef294b62765b Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Sun, 28 Oct 2018 21:15:04 +0100 Subject: [PATCH] Do not clear asset on HEAD request If Collabora sends a head request to obtain info about the assets we should not directly delete it. Instead just let it be if it is a HEAD request. Signed-off-by: Roeland Jago Douma --- lib/Controller/AssetsController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Controller/AssetsController.php b/lib/Controller/AssetsController.php index 6f620d3b6..b6fb80f64 100644 --- a/lib/Controller/AssetsController.php +++ b/lib/Controller/AssetsController.php @@ -103,8 +103,11 @@ class AssetsController extends Controller { return new DataResponse([], Http::STATUS_NOT_FOUND); } - // Clear the assets so we can only fetch it once - $this->assetMapper->delete($asset); + // Do not clear the asset on HEAD requests + if ($this->request->getMethod() === 'GET') { + // Clear the assets so we can only fetch it once + $this->assetMapper->delete($asset); + } $userFolder = $this->rootFolder->getUserFolder($asset->getUid()); $nodes = $userFolder->getById($asset->getFileid());