diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-22 16:43:12 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-22 16:43:12 +0000 |
commit | dafeebf12d4a930a99e5d3917ba070ebefefd23f (patch) | |
tree | 4010aedbc93b40fbdec47395577a79c2115d393a /test/webrick/webrick.cgi | |
parent | ef41381d2e6156bbe4dc97d9e3b4f9c7c257cff4 (diff) |
webrick: filter out HTTP_PROXY for CGIHandler
* lib/webrick/httpservlet/cgihandler.rb (do_GET): delete HTTP_PROXY
* test/webrick/test_cgi.rb (test_cgi_env): new test
* test/webrick/webrick.cgi (do_GET): new endpoint to dump env
[ruby-core:76511] [Bug #12610]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick/webrick.cgi')
-rw-r--r-- | test/webrick/webrick.cgi | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/webrick/webrick.cgi b/test/webrick/webrick.cgi index 43c1af825c..a294fa72f9 100644 --- a/test/webrick/webrick.cgi +++ b/test/webrick/webrick.cgi @@ -4,7 +4,9 @@ require "webrick/cgi" class TestApp < WEBrick::CGI def do_GET(req, res) res["content-type"] = "text/plain" - if (p = req.path_info) && p.length > 0 + if req.path_info == "/dumpenv" + res.body = Marshal.dump(ENV.to_hash) + elsif (p = req.path_info) && p.length > 0 res.body = p elsif (q = req.query).size > 0 res.body = q.keys.sort.collect{|key| |