diff options
author | Jorge Bejar <jorge@wyeworks.com> | 2015-12-29 11:39:58 -0300 |
---|---|---|
committer | Jorge Bejar <jorge@wyeworks.com> | 2015-12-29 13:42:57 -0300 |
commit | 9a85da9367eaf65b4232a548ff1f2535ef3496cd (patch) | |
tree | 10c33c53560c9f5a6734ff669218278d1b384c51 /actionpack/lib | |
parent | 929c61573e289e432a4e571ae157248745ae2eae (diff) | |
download | rails-9a85da9367eaf65b4232a548ff1f2535ef3496cd.tar.gz rails-9a85da9367eaf65b4232a548ff1f2535ef3496cd.tar.bz2 rails-9a85da9367eaf65b4232a548ff1f2535ef3496cd.zip |
Rely on default Mime format when MimeNegotiation#format_from_path_extension is not a valid type
Closes #22747
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_negotiation.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_negotiation.rb b/actionpack/lib/action_dispatch/http/mime_negotiation.rb index 0152c17ed4..eb9c2a18cb 100644 --- a/actionpack/lib/action_dispatch/http/mime_negotiation.rb +++ b/actionpack/lib/action_dispatch/http/mime_negotiation.rb @@ -67,8 +67,8 @@ module ActionDispatch v = if params_readable Array(Mime[parameters[:format]]) - elsif format = format_from_path_extension - Array(Mime[format]) + elsif extension_format = format_from_path_extension + [extension_format] elsif use_accept_header && valid_accept_header accepts elsif xhr? @@ -166,7 +166,7 @@ module ActionDispatch def format_from_path_extension path = @env['action_dispatch.original_path'] || @env['PATH_INFO'] if match = path && path.match(/\.(\w+)\z/) - match.captures.first + Mime[match.captures.first] end end end |