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 <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-10-28 21:15:04 +01:00
Родитель a690d98e33
Коммит 2b8ad9f9a8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F941078878347C0C
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -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());