Skip to content

Commit

Permalink
Merge pull request #49851 from nextcloud/backport/49839/stable30
Browse files Browse the repository at this point in the history
[stable30] fix: return 204 instead of 404
  • Loading branch information
SebastianKrupinski authored Dec 13, 2024
2 parents 0475b0c + 2f46f98 commit 828594c
Show file tree
Hide file tree
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
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 828594c

Please sign in to comment.