File tree 2 files changed +7
-1
lines changed
lib/action_controller/metal
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def process_action(*args)
19
19
:controller => self . class . name ,
20
20
:action => self . action_name ,
21
21
:params => request . filtered_parameters ,
22
- :format => request . format . ref ,
22
+ :format => request . format . try ( : ref) ,
23
23
:method => request . method ,
24
24
:path => ( request . fullpath rescue "unknown" )
25
25
}
Original file line number Diff line number Diff line change @@ -498,6 +498,12 @@ def test_format_with_custom_response_type_and_request_headers
498
498
assert_equal '<html><div id="iphone">Hello iPhone future from iPhone!</div></html>' , @response . body
499
499
assert_equal "text/html" , @response . content_type
500
500
end
501
+
502
+ def test_invalid_format
503
+ get :using_defaults , :format => "invalidformat"
504
+ assert_equal " " , @response . body
505
+ assert_equal "text/html" , @response . content_type
506
+ end
501
507
end
502
508
503
509
class RespondWithController < ActionController ::Base
You can’t perform that action at this time.
0 commit comments