diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-11-23 14:33:11 -0700 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-11-23 14:33:11 -0700 |
commit | 8404ed6408e17efda09bf568e79eba36858be5d9 (patch) | |
tree | 94a4b872f399c3c0594c93f07dbb733938ebe2a8 /actionpack/lib/action_dispatch/http/request.rb | |
parent | 65a61ab7c370d2894c11ce276725f723a5c9c111 (diff) | |
parent | 7f546318d56b75bafb798d0c178578600fd6939e (diff) | |
download | rails-8404ed6408e17efda09bf568e79eba36858be5d9.tar.gz rails-8404ed6408e17efda09bf568e79eba36858be5d9.tar.bz2 rails-8404ed6408e17efda09bf568e79eba36858be5d9.zip |
Merge pull request #17928 from sergey-alekseev/remove-unused-form-data-method
Diffstat (limited to 'actionpack/lib/action_dispatch/http/request.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index ea61ad0c02..bd0f38953a 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -306,10 +306,16 @@ module ActionDispatch end end - # Returns true if the request's content MIME type is - # +application/x-www-form-urlencoded+ or +multipart/form-data+. + # Determine whether the request body contains form-data by checking + # the request Content-Type for one of the media-types: + # "application/x-www-form-urlencoded" or "multipart/form-data". The + # list of form-data media types can be modified through the + # +FORM_DATA_MEDIA_TYPES+ array. + # + # A request body is not assumed to contain form-data when no + # Content-Type header is provided and the request_method is POST. def form_data? - FORM_DATA_MEDIA_TYPES.include?(content_mime_type.to_s) + FORM_DATA_MEDIA_TYPES.include?(media_type) end def body_stream #:nodoc: |