From 9f1c9f35c7f378f7fe55b83baf33ce6404772372 Mon Sep 17 00:00:00 2001 From: Tom <83423411+tom27052006@users.noreply.github.com> Date: Wed, 9 Sep 2026 13:12:24 +0200 Subject: [PATCH] fix register verification response content negotiation --- src/api/identity.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/api/identity.rs b/src/api/identity.rs index 42a287e0..6808ddde 100644 --- a/src/api/identity.rs +++ b/src/api/identity.rs @@ -1086,10 +1086,9 @@ enum RegisterVerificationResponse { PlainToken(String), } -// The iOS client sends `Accept: */*` and reads the raw body as its token, so it would end up with -// the quotes of a JSON string. Every other client keeps the JSON string. +// Return JSON only when the client explicitly requests it, otherwise return plain text. fn accepts_json(accept: Option<&Accept>) -> bool { - accept.is_none_or(|accept| accept.preferred().media_type() != &MediaType::Any) + accept.is_some_and(|accept| accept.preferred().media_type() == &MediaType::JSON) } #[post("/accounts/register/send-verification-email", data = "")]