From 1e8c6e2ba4eb4305a756f650248283ecad4f36cb Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Mon, 17 Dec 2007 07:03:57 +0000 Subject: * 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 --- test/webrick/test_httprequest.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/webrick/test_httprequest.rb') diff --git a/test/webrick/test_httprequest.rb b/test/webrick/test_httprequest.rb index f0cd1a092a..f2fd887873 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 -- cgit v1.2.3