aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/headers.rb
diff options
context:
space:
mode:
authorBart de Water <bartdewater@gmail.com>2018-07-28 17:37:17 -0400
committerBart de Water <bartdewater@gmail.com>2018-07-28 17:37:17 -0400
commiteb5fea40a404e829f00552859ae1b206728d99d7 (patch)
tree3abe3c813b8e64c5bb009902166953a616786232 /actionpack/lib/action_dispatch/http/headers.rb
parent8741052ba25722283ea057f6f022f16b1931ce3e (diff)
downloadrails-eb5fea40a404e829f00552859ae1b206728d99d7.tar.gz
rails-eb5fea40a404e829f00552859ae1b206728d99d7.tar.bz2
rails-eb5fea40a404e829f00552859ae1b206728d99d7.zip
Enable Start/EndWith and RegexpMatch cops
In cases where the MatchData object is not used, this provides a speed-up: https://github.com/JuanitoFatas/fast-ruby/#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end
Diffstat (limited to 'actionpack/lib/action_dispatch/http/headers.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/headers.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/headers.rb b/actionpack/lib/action_dispatch/http/headers.rb
index c3c2a9d8c5..6c7d24d2d0 100644
--- a/actionpack/lib/action_dispatch/http/headers.rb
+++ b/actionpack/lib/action_dispatch/http/headers.rb
@@ -121,7 +121,7 @@ module ActionDispatch
# not contained within the headers hash.
def env_name(key)
key = key.to_s
- if key =~ HTTP_HEADER
+ if HTTP_HEADER.match?(key)
key = key.upcase.tr("-", "_")
key = "HTTP_" + key unless CGI_VARIABLES.include?(key)
end