simple_datatables icon indicating copy to clipboard operation
simple_datatables copied to clipboard

Don't clobber the JSON MIME type.

Open meadmaker opened this issue 10 years ago • 0 comments

simple_datatables was preventing Rails from parsing POST messages with a JSON body. The reason was that Mime::Type.register will associate a symbol with a mime type for both content generation (outbound HTTP responses, for instance) and content parsing (inbound HTTP requests), so when the middleware retrieved the identifying symbol associated with the application/json datatype, it got back :datatables, which it ignored. Mime::Type.register_alias will associate the symbol with the mime type for content generation only, so parsing the JSON body into a parameters array still works.

meadmaker avatar Dec 12 '14 15:12 meadmaker