From cdb7a8477ff19f8ed6f549cedc901bd5934a61e8 Mon Sep 17 00:00:00 2001 From: Jorge Bejar Date: Wed, 9 Dec 2015 14:18:13 -0300 Subject: Avoid calling AD::MimeNegotiation#format_from_path_extension method twice --- actionpack/lib/action_dispatch/http/mime_negotiation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_dispatch/http/mime_negotiation.rb b/actionpack/lib/action_dispatch/http/mime_negotiation.rb index 004713ec1a..0152c17ed4 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_from_path_extension - [Mime[format_from_path_extension]] + elsif format = format_from_path_extension + Array(Mime[format]) elsif use_accept_header && valid_accept_header accepts elsif xhr? -- cgit v1.2.3