Skip to content

Commit

Permalink
fix: return 204 instead of 404
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
  • Loading branch information
SebastianKrupinski authored and backportbot[bot] committed Dec 13, 2024
1 parent 0475b0c commit 2f46f98
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/ImageExportPlugin.php
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 2f46f98

Please sign in to comment.