diff --git a/lib/Controller/AvatarsController.php b/lib/Controller/AvatarsController.php index 4dc20790b6..431600bfb9 100644 --- a/lib/Controller/AvatarsController.php +++ b/lib/Controller/AvatarsController.php @@ -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) diff --git a/tests/Unit/Controller/AvatarControllerTest.php b/tests/Unit/Controller/AvatarControllerTest.php index b67608172f..c566493cbe 100644 --- a/tests/Unit/Controller/AvatarControllerTest.php +++ b/tests/Unit/Controller/AvatarControllerTest.php @@ -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); }