From 2f46f9801b109e0ce4dd1ab1c95d748568b73415 Mon Sep 17 00:00:00 2001 From: SebastianKrupinski Date: Thu, 12 Dec 2024 23:06:01 -0500 Subject: [PATCH] fix: return 204 instead of 404 Signed-off-by: SebastianKrupinski --- apps/dav/lib/CardDAV/ImageExportPlugin.php | 2 +- apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/CardDAV/ImageExportPlugin.php b/apps/dav/lib/CardDAV/ImageExportPlugin.php index f8c2b6ee82774..e2173db519be4 100644 --- a/apps/dav/lib/CardDAV/ImageExportPlugin.php +++ b/apps/dav/lib/CardDAV/ImageExportPlugin.php @@ -91,7 +91,7 @@ public function httpGet(RequestInterface $request, ResponseInterface $response) $response->setBody($file->getContent()); } catch (NotFoundException $e) { - $response->setStatus(404); + $response->setStatus(\OCP\AppFramework\Http::STATUS_NO_CONTENT); } return false; diff --git a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php index 6718153f91041..cf6ddb1ff7b5a 100644 --- a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php +++ b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php @@ -171,7 +171,7 @@ public function testCard($size, $photo): void { ->willThrowException(new NotFoundException()); $this->response->expects($this->once()) ->method('setStatus') - ->with(404); + ->with(\OCP\AppFramework\Http::STATUS_NO_CONTENT); } $result = $this->plugin->httpGet($this->request, $this->response);