Skip to content

Commit 5f1b41d

Browse files
obriemrpasquini
authored andcommitted
Fix ActionDispatch::Request::HTTP_METHOD_LOOKUP being impacted by inflections from gems
If a gem adds inflections before action_dispatch/http/request is loaded into the runtime, then it's possible that calls to method#underscore cause invalid values to be generated. For example, if a gem adds "OS" as an acronym, then this will cause "POST" to be converted to :p_os_t.
1 parent d7fad4b commit 5f1b41d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionpack/lib/action_dispatch/http/request.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def key?(key)
138138

139139
# Populate the HTTP method lookup cache.
140140
HTTP_METHODS.each { |method|
141-
HTTP_METHOD_LOOKUP[method] = method.underscore.to_sym
141+
HTTP_METHOD_LOOKUP[method] = method.downcase.underscore.to_sym
142142
}
143143

144144
alias raw_request_method request_method # :nodoc:

0 commit comments

Comments
 (0)