File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
actionpack/lib/action_controller/metal Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,20 @@ module Head
18
18
# render
19
19
#
20
20
# See Rack::Utils::SYMBOL_TO_STATUS_CODE for a full list of valid +status+ symbols.
21
- def head ( status , options = { } )
21
+ def head ( status , options = nil )
22
22
if status . is_a? ( Hash )
23
23
raise ArgumentError , "#{ status . inspect } is not a valid value for `status`."
24
24
end
25
25
26
26
status ||= :ok
27
27
28
- location = options . delete ( :location )
29
- content_type = options . delete ( :content_type )
28
+ if options
29
+ location = options . delete ( :location )
30
+ content_type = options . delete ( :content_type )
30
31
31
- options . each do |key , value |
32
- headers [ key . to_s . split ( /[-_]/ ) . each { |v | v [ 0 ] = v [ 0 ] . upcase } . join ( "-" ) ] = value . to_s
32
+ options . each do |key , value |
33
+ headers [ key . to_s . split ( /[-_]/ ) . each { |v | v [ 0 ] = v [ 0 ] . upcase } . join ( "-" ) ] = value . to_s
34
+ end
33
35
end
34
36
35
37
self . status = status
You can’t perform that action at this time.
0 commit comments