diff --git a/apps/dav/lib/CardDAV/ImageExportPlugin.php b/apps/dav/lib/CardDAV/ImageExportPlugin.php index 3ebc91e55331b..542d8c88c5a26 100644 --- a/apps/dav/lib/CardDAV/ImageExportPlugin.php +++ b/apps/dav/lib/CardDAV/ImageExportPlugin.php @@ -108,7 +108,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 6f48927646ec8..deda3d2427cbb 100644 --- a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php +++ b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php @@ -189,7 +189,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);