--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAFfBxfEiWFV8GSmpsxxy8PR6i_N5ywZVdgndJAv3o2LgBj_bmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Hi Yann,The Akka HTTP server actually tries to parse the Content-Type intelligently. Since application/json does not define a charset parameter (https://www.iana.org/assignments/media-types/application/json), it omits that parameter when we render the Akka HTTP content type as a string. Play's JSON body parsers use Jackson to parse the bytes of the JSON, which detects the encoding according to the spec and does not look at the charset parameter (this was the case in 2.5 as well).In your case, it should make no difference, since UTF-8 is a valid charset for JSON, and that will be autodetected by the parser.So it's not a bug in the sense that it shouldn't affect spec-compliant recipients, but might affect certain non-spec-compliant users. There's some debate about it here: https://github.com/playframework/playframework/pull/7498.GregOn Wed, Jun 28, 2017 at 9:06 AM, Yann Simon <yann.s...@gmail.com> wrote:YannIs it something expected or a bug?When sending a request with the content type "text/plain;charset=UTF-8", request.mediaType is "Some(text/plain; charset=UTF-8)" (and the charset is then "UTF-8")Hi,When sending a request with the content type "application/json;charset=UTF-8", request.mediaType is "Some(application/json)"
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAFfBxfEiWFV8GSmpsxxy8PR6i_N5ywZVdgndJAv3o2LgBj_bmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAA%3D11HyUESPa7%2B2rHYYMcvMGyAOVq%2BC-LdcPZjnYa52z5Hqtew%40mail.gmail.com.
But we can also parse the json payload as text (tolerant text for example). In that case, the payload is wrongly decoded as this parser does not default to utf-8 and cannot use the charset send by the client.
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/2ae9ccd8-d7a2-4d09-9a68-8e95db81084b%40googlegroups.com.
Just like the other tolerant body parsers, since "text" parses "text/plain", "tolerantText" assumes "text/plain" and tries to parse using the same rules, without validating the content type. This means it happens to work with other text content types that use ISO-8859-1 as the default. It's not meant to parse application/json, application/xml, etc.The issue of using tolerantText on JSON has also been discussed in the past: https://github.com/playframework/playframework/issues/5334
On Wed, Jun 28, 2017 at 2:29 PM, Igmar Palsenberg <ig...@palsenberg.com> wrote:
But we can also parse the json payload as text (tolerant text for example). In that case, the payload is wrongly decoded as this parser does not default to utf-8 and cannot use the charset send by the client.Officially, you can't. JSON is UTF-8, UTF-16, or UTF-32. Anything else is invalid. If it doesn't default to UTF-8, it's broken according to the RFC.Igmar
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/2ae9ccd8-d7a2-4d09-9a68-8e95db81084b%40googlegroups.com.
--
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAA%3D11HzpC6_67Bk-%3D4yXPr%3D%2BZ_PmWKsMn8dp%3DiGmxQw6AbGtaQ%40mail.gmail.com.