Skip to content

Commit

Permalink
Merge pull request #49839 from nextcloud/fix/issue-3021-return-no-con…
Browse files Browse the repository at this point in the history
…tent-instead-of-error

fix: return 204 instead of 404
  • Loading branch information
SebastianKrupinski authored Dec 13, 2024
2 parents 10852d3 + 0628eb6 commit afc4b0a
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 @@ -90,7 +90,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 afc4b0a

Please sign in to comment.