summaryrefslogtreecommitdiff
path: root/test/webrick/webrick.cgi
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-11-02 13:44:28 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-10 18:06:25 +0900
commit5dc786bf86bb6e0da2639f88659598ec8b9db30d (patch)
tree87cc4d68088fc7c2616c7c1bef44c36ca10fa01f /test/webrick/webrick.cgi
parent46d3ea2c2569e2e5a9ee3e7e206f07f0f8b693f5 (diff)
Move webrick library into internal test toolchain
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3729
Diffstat (limited to 'test/webrick/webrick.cgi')
-rw-r--r--test/webrick/webrick.cgi38
1 files changed, 0 insertions, 38 deletions
diff --git a/test/webrick/webrick.cgi b/test/webrick/webrick.cgi
deleted file mode 100644
index a294fa72f9..0000000000
--- a/test/webrick/webrick.cgi
+++ /dev/null
@@ -1,38 +0,0 @@
-#!ruby
-require "webrick/cgi"
-
-class TestApp < WEBrick::CGI
- def do_GET(req, res)
- res["content-type"] = "text/plain"
- 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|
- q[key].list.sort.collect{|v|
- "#{key}=#{v}"
- }.join(", ")
- }.join(", ")
- elsif %r{/$} =~ req.request_uri.to_s
- res.body = ""
- res.body << req.request_uri.to_s << "\n"
- res.body << req.script_name
- elsif !req.cookies.empty?
- res.body = req.cookies.inject(""){|result, cookie|
- result << "%s=%s\n" % [cookie.name, cookie.value]
- }
- res.cookies << WEBrick::Cookie.new("Customer", "WILE_E_COYOTE")
- res.cookies << WEBrick::Cookie.new("Shipping", "FedEx")
- else
- res.body = req.script_name
- end
- end
-
- def do_POST(req, res)
- do_GET(req, res)
- end
-end
-
-cgi = TestApp.new
-cgi.start