diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-02-22 17:20:37 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-02-22 21:22:29 -0300 |
commit | a087cf4312c1ec01f3bb021a6791ac3a6ef1cec3 (patch) | |
tree | 847d9cf9d8e4c6f17e0fc391273edb80e1992f15 /actionpack/lib/action_dispatch/middleware/params_parser.rb | |
parent | 97ed810cfc15725a0856227fa9f9eb26930f16c8 (diff) | |
download | rails-a087cf4312c1ec01f3bb021a6791ac3a6ef1cec3.tar.gz rails-a087cf4312c1ec01f3bb021a6791ac3a6ef1cec3.tar.bz2 rails-a087cf4312c1ec01f3bb021a6791ac3a6ef1cec3.zip |
Transform the mime object to symbol when registering the parsers
This will keep our current API working without having the users to
change their codebases.
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/params_parser.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/params_parser.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb index c2a4f46e67..5841c978af 100644 --- a/actionpack/lib/action_dispatch/middleware/params_parser.rb +++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb @@ -37,6 +37,7 @@ module ActionDispatch # The +parsers+ argument can take Hash of parsers where key is identifying # content mime type, and value is a lambda that is going to process data. def self.new(app, parsers = {}) + parsers = parsers.transform_keys { |key| key.respond_to?(:symbol) ? key.symbol : key } ActionDispatch::Request.parameter_parsers = ActionDispatch::Request::DEFAULT_PARSERS.merge(parsers) app end |