diff --git a/lib/Controller/AvatarsController.php b/lib/Controller/AvatarsController.php index c4a7476a41..9e900c2d92 100644 --- a/lib/Controller/AvatarsController.php +++ b/lib/Controller/AvatarsController.php @@ -67,7 +67,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 c40c2ef943..ed005bd911 100644 --- a/tests/Unit/Controller/AvatarControllerTest.php +++ b/tests/Unit/Controller/AvatarControllerTest.php @@ -95,7 +95,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); }