mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Reduce String allocations while handling HTTP headers
This commit is contained in:
parent
934b104fb0
commit
c45eaffa27
1 changed files with 3 additions and 2 deletions
|
@ -121,8 +121,9 @@ module ActionDispatch
|
||||||
def env_name(key)
|
def env_name(key)
|
||||||
key = key.to_s
|
key = key.to_s
|
||||||
if HTTP_HEADER.match?(key)
|
if HTTP_HEADER.match?(key)
|
||||||
key = key.upcase.tr("-", "_")
|
key = key.upcase
|
||||||
key = "HTTP_" + key unless CGI_VARIABLES.include?(key)
|
key.tr!("-", "_")
|
||||||
|
key.prepend("HTTP_") unless CGI_VARIABLES.include?(key)
|
||||||
end
|
end
|
||||||
key
|
key
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue