niko/rack-post-body-to-params — Issue #1: mapping parsers to content-type breaks down when charset specified
Author: pheino
Created: 2012-01-27 02:01:32+00:00
State: open

If the client passing "Content-type: application/xml; charset=utf-8" the gem (and maybe active support) does not see a parser registered so it doesnt parse the XML and return an empty params hash.

What is your recommendation to fix this issue?

The charset is a standard part of the content-type header according to the HTTP RFCs.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

14.17 Content-Type

The Content-Type entity-header field indicates the media type of the entity-body sent to the recipient or, in the case of the HEAD method, the media type that would have been sent had the request been a GET.

Content-Type = "Content-Type" ":" media-type

Media types are defined in section 3.7. An example of the field is

Content-Type: text/html; charset=ISO-8859-4

Further discussion of methods for identifying the media type of an entity is provided in section 7.2.1.