diff options
author | wycats <wycats@gmail.com> | 2010-03-28 13:40:38 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-03-28 13:40:38 -0700 |
commit | 77a2a3d9b3aa461437ced326ea4a70112a8c68ed (patch) | |
tree | eb236e6832815f95629d4b00a475e19dc2e575aa /actionpack/lib/action_dispatch/middleware/params_parser.rb | |
parent | e1a70faea675499d717cef7662262ceb03b23975 (diff) | |
download | rails-77a2a3d9b3aa461437ced326ea4a70112a8c68ed.tar.gz rails-77a2a3d9b3aa461437ced326ea4a70112a8c68ed.tar.bz2 rails-77a2a3d9b3aa461437ced326ea4a70112a8c68ed.zip |
Request#content_type exists in Rack::Request, and other parts of Rack::Request expect
it to return a String. Split the Rails API so that Request#content_type returns
a String, and Request#content_mime_type returns a Mime::Type object.
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/params_parser.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/params_parser.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb index f4c4324fb0..18a3688bb0 100644 --- a/actionpack/lib/action_dispatch/middleware/params_parser.rb +++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb @@ -25,7 +25,9 @@ module ActionDispatch return false if request.content_length.zero? - mime_type = content_type_from_legacy_post_data_format_header(env) || request.content_type + mime_type = content_type_from_legacy_post_data_format_header(env) || + request.content_mime_type + strategy = @parsers[mime_type] return false unless strategy @@ -53,7 +55,7 @@ module ActionDispatch raise { "body" => request.raw_post, - "content_type" => request.content_type, + "content_type" => request.content_mime_type, "content_length" => request.content_length, "exception" => "#{e.message} (#{e.class})", "backtrace" => e.backtrace } |