diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2019-03-19 09:22:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-19 09:22:16 -0400 |
commit | 7fe3c69331175a64f01ef64e7afab6d9236fbdbc (patch) | |
tree | d8df19bd0295fe46cd6f311ed47efea016e78bc6 /actionpack/lib/action_dispatch/testing | |
parent | 969a1416ebbb74ffb50617ae00029308e8d4f176 (diff) | |
parent | b5e8942c95078945ff09a83b2fc03a0ae7e35953 (diff) | |
download | rails-7fe3c69331175a64f01ef64e7afab6d9236fbdbc.tar.gz rails-7fe3c69331175a64f01ef64e7afab6d9236fbdbc.tar.bz2 rails-7fe3c69331175a64f01ef64e7afab6d9236fbdbc.zip |
Merge pull request #35604 from jhawthorn/validate_mime_types
Raise exception when building invalid mime type
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/request_encoder.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/testing/request_encoder.rb b/actionpack/lib/action_dispatch/testing/request_encoder.rb index 9889f61951..6c65bec62f 100644 --- a/actionpack/lib/action_dispatch/testing/request_encoder.rb +++ b/actionpack/lib/action_dispatch/testing/request_encoder.rb @@ -38,8 +38,8 @@ module ActionDispatch end def self.parser(content_type) - mime = Mime::Type.lookup(content_type) - encoder(mime ? mime.ref : nil).response_parser + type = Mime::Type.lookup(content_type).ref if content_type + encoder(type).response_parser end def self.encoder(name) |