Skip to content

Commit 7bc0976

Browse files
committed
Skip inflector when generating HTTP_METHOD_LOOKUP
HTTP_METHOD_LOOKUP's creation was recently updated to explicitly use `downcase` since an application's custom inflections could previously affect it. However, `underscore` is still present even though the only transformation needed after `downcase` is substituting `-` for `_`. Since `underscore` is overkill in this case, this commit replaces it with `tr!`.
1 parent 892955b commit 7bc0976

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionpack/lib/action_dispatch/http/request.rb

Lines changed: 1 addition & 1 deletion
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.downcase.underscore.to_sym
141+
HTTP_METHOD_LOOKUP[method] = method.downcase.tap { |m| m.tr!("-", "_") }.to_sym
142142
}
143143

144144
alias raw_request_method request_method # :nodoc:

0 commit comments

Comments
 (0)