diff options
Diffstat (limited to 'lib/cgi')
-rw-r--r-- | lib/cgi/core.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb index 3fb8dbab54..c45f9b3a9e 100644 --- a/lib/cgi/core.rb +++ b/lib/cgi/core.rb @@ -421,7 +421,7 @@ class CGI module QueryExtension %w[ CONTENT_LENGTH SERVER_PORT ].each do |env| - define_method(env.sub(/^HTTP_/, '').downcase) do + define_method(env.delete_prefix('HTTP_').downcase) do (val = env_table[env]) && Integer(val) end end @@ -434,7 +434,7 @@ class CGI HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING HTTP_ACCEPT_LANGUAGE HTTP_CACHE_CONTROL HTTP_FROM HTTP_HOST HTTP_NEGOTIATE HTTP_PRAGMA HTTP_REFERER HTTP_USER_AGENT ].each do |env| - define_method(env.sub(/^HTTP_/, '').downcase) do + define_method(env.delete_prefix('HTTP_').downcase) do env_table[env] end end |