ring-middleware-format
ring-middleware-format copied to clipboard
Charset is not extracted from "Content-Type" header
I pass a header content-type: application/json; charset=utf-8
in the HTTP request, but the lib ignores it and decides to instead infer the encoding which sometimes leads to :body becoming garbage.
I believe this function should do (get-in req [:headers "content-type"]
, not (get req :content-type)
. Or is there something else going on? In https://github.com/ngrunwald/ring-middleware-format/blob/master/src/ring/middleware/format_params.clj#L32
Ring used to add content-type to the request map: https://github.com/ring-clojure/ring/blob/master/SPEC#L82
As it has been deprecated, maybe new Ring no longer does this?
Muuntaja reads request content-type first and then reads the header directly: https://github.com/metosin/muuntaja/blob/master/src/clj/muuntaja/core.clj#L124