From 1b31bbe2c43ff8569d319d7c8663daabbb0cd029 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Tue, 18 Jan 2005 06:03:43 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'ruby_1_8'. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/webrick/webrick.cgi | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/webrick/webrick.cgi (limited to 'test/webrick/webrick.cgi') diff --git a/test/webrick/webrick.cgi b/test/webrick/webrick.cgi new file mode 100644 index 000000000..97e137745 --- /dev/null +++ b/test/webrick/webrick.cgi @@ -0,0 +1,26 @@ +#!ruby -d +require "webrick/cgi" + +class TestApp < WEBrick::CGI + def do_GET(req, res) + res["content-type"] = "text/plain" + if p = req.path_info + 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(", ") + else + res.body = req.script_name + end + end + + def do_POST(req, res) + do_GET(req, res) + end +end + +cgi = TestApp.new +cgi.start -- cgit