summaryrefslogtreecommitdiff
path: root/test/webrick/test_httprequest.rb
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-17 07:03:57 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-17 07:03:57 +0000
commit1e8c6e2ba4eb4305a756f650248283ecad4f36cb (patch)
treec039ee1a23b5b8fa6de191bfdc3476578f37407a /test/webrick/test_httprequest.rb
parent3f07e548fc8b1247824a008c970fcbcf10116a93 (diff)
* lib/webrick/httprequest.rb, lib/webrick/cgi.rb: Request-Line or
header fields shold be read with maximum length. [ruby-talk:231745] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick/test_httprequest.rb')
-rw-r--r--test/webrick/test_httprequest.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/webrick/test_httprequest.rb b/test/webrick/test_httprequest.rb
index f0cd1a092ac..f2fd887873a 100644
--- a/test/webrick/test_httprequest.rb
+++ b/test/webrick/test_httprequest.rb
@@ -56,6 +56,16 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase
assert(req.query.empty?)
end
+ def test_request_uri_too_large
+ msg = <<-_end_of_message_
+ GET /#{"a"*1024} HTTP/1.1
+ _end_of_message_
+ req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
+ assert_raises(WEBrick::HTTPStatus::RequestURITooLarge){
+ req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
+ }
+ end
+
def test_parse_headers
msg = <<-_end_of_message_
GET /path HTTP/1.1