Skip to content

Commit

Permalink
Merge pull request #10694 from nextcloud/bug/noid/avatar-204
Browse files Browse the repository at this point in the history
fix: change status code from 404 to 204 for missing avatars
  • Loading branch information
kesselb authored Feb 14, 2025
2 parents bcd5239 + 92bf4ef commit aa451b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Controller/AvatarsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function url(string $email): JSONResponse {
$avatar = $this->avatarService->getAvatar($email, $this->uid);
if (is_null($avatar)) {
// No avatar found
$response = new JSONResponse([], Http::STATUS_NOT_FOUND);
$response = new JSONResponse([], Http::STATUS_NO_CONTENT);

// Debounce this a bit
// (cache for one day)
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Controller/AvatarControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testGetUrlNoAvatarFound() {

$resp = $this->controller->url($email);

$expected = new JSONResponse([], Http::STATUS_NOT_FOUND);
$expected = new JSONResponse([], Http::STATUS_NO_CONTENT);
$expected->cacheFor(24 * 60 * 60, false, true);
$this->assertEquals($expected, $resp);
}
Expand Down

0 comments on commit aa451b7

Please sign in to comment.