Skip to content

fix: change status code from 404 to 204 for missing avatars#10694

Merged
kesselb merged 1 commit intomainfrom
bug/noid/avatar-204
Feb 14, 2025
Merged

fix: change status code from 404 to 204 for missing avatars#10694
kesselb merged 1 commit intomainfrom
bug/noid/avatar-204

Conversation

@kesselb
Copy link
Contributor

@kesselb kesselb commented Feb 14, 2025

Similar to nextcloud/contacts#3021 and nextcloud/server#49839.

Switching the response code from 404 to 204 improves compatibility with security appliances like CrowdSec.
Since avatar lookups (including external sources) can validly result in a non-existing avatar.

Bonus: This will not trigger the debug log for missing avatars anylonger.

logger.debug('Could not fetch avatar', { email: this.email })

There's another action in the controller also using 404.
I'm not sure where we are using it and therefore left it unchanged:

$response->setStatus(Http::STATUS_NOT_FOUND);

Switching the response code from 404 to 204 improves compatibility with security appliances like CrowdSec.
Since avatar lookups (including external sources) can validly result in a non-existing avatar.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@SebastianKrupinski
Copy link
Contributor

Bonus: This will not trigger the debug log for missing avatars anylonger.

This will be such a nice improvement!!!

@kesselb kesselb merged commit aa451b7 into main Feb 14, 2025
28 of 35 checks passed
@kesselb kesselb deleted the bug/noid/avatar-204 branch February 14, 2025 15:55
@kesselb
Copy link
Contributor Author

kesselb commented Feb 14, 2025

/backport to stable4.2

@kesselb
Copy link
Contributor Author

kesselb commented Feb 14, 2025

/backport to stable4.1

@kesselb
Copy link
Contributor Author

kesselb commented Feb 14, 2025

/backport to stable3.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants