diff options
author | Nathaniel Bibler <git@nathanielbibler.com> | 2014-06-05 22:05:02 -0400 |
---|---|---|
committer | Nathaniel Bibler <git@nathanielbibler.com> | 2014-06-05 22:05:02 -0400 |
commit | e7b0947afdc8c9f4119d06628070667b9e7875d1 (patch) | |
tree | a244dc21ace86c725710ba9cb9dbceb69c479035 | |
parent | aa54c91a151b47656320b511b30f546180202458 (diff) | |
download | rails-e7b0947afdc8c9f4119d06628070667b9e7875d1.tar.gz rails-e7b0947afdc8c9f4119d06628070667b9e7875d1.tar.bz2 rails-e7b0947afdc8c9f4119d06628070667b9e7875d1.zip |
Use a frozen Set instance for CGI_VARIABLES.
Also expand the CGI_VARIABLE name listing to multiple lines for cleaner diffs and legibility.
-rw-r--r-- | actionpack/lib/action_dispatch/http/headers.rb | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/http/headers.rb b/actionpack/lib/action_dispatch/http/headers.rb index 3e607bbde1..bc5410dc38 100644 --- a/actionpack/lib/action_dispatch/http/headers.rb +++ b/actionpack/lib/action_dispatch/http/headers.rb @@ -6,14 +6,27 @@ module ActionDispatch # headers = ActionDispatch::Http::Headers.new(env) # headers["Content-Type"] # => "text/plain" class Headers - CGI_VARIABLES = %w( - CONTENT_TYPE CONTENT_LENGTH - HTTPS AUTH_TYPE GATEWAY_INTERFACE - PATH_INFO PATH_TRANSLATED QUERY_STRING - REMOTE_ADDR REMOTE_HOST REMOTE_IDENT REMOTE_USER - REQUEST_METHOD SCRIPT_NAME - SERVER_NAME SERVER_PORT SERVER_PROTOCOL SERVER_SOFTWARE - ) + CGI_VARIABLES = Set.new(%W[ + AUTH_TYPE + CONTENT_LENGTH + CONTENT_TYPE + GATEWAY_INTERFACE + HTTPS + PATH_INFO + PATH_TRANSLATED + QUERY_STRING + REMOTE_ADDR + REMOTE_HOST + REMOTE_IDENT + REMOTE_USER + REQUEST_METHOD + SCRIPT_NAME + SERVER_NAME + SERVER_PORT + SERVER_PROTOCOL + SERVER_SOFTWARE + ]).freeze + HTTP_HEADER = /\A[A-Za-z0-9-]+\z/ include Enumerable |