From 742c4d77f179a757dbcb1fa350f9d75b757acfc7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 15 Jun 2011 00:08:03 +0000 Subject: test_http_parser: fix for URI too long errors The random garbage generator may occasionally generate URIs that are too long and cause the URI-specific error to be raised instead of the generic parser error we recently introduced. --- test/unit/test_http_parser.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/test_http_parser.rb b/test/unit/test_http_parser.rb index 70bb789..e6a990d 100644 --- a/test/unit/test_http_parser.rb +++ b/test/unit/test_http_parser.rb @@ -740,7 +740,7 @@ class HttpParserTest < Test::Unit::TestCase # then that large header names are caught 10.times do |c| get = "GET /#{rand_data(10,120)} HTTP/1.1\r\nX-#{rand_data(1024, 1024+(c*1024))}: Test\r\n\r\n" - assert_raises Unicorn::HttpParserError do + assert_raises(Unicorn::HttpParserError,Unicorn::RequestURITooLongError) do parser.buf << get parser.parse parser.clear @@ -750,7 +750,7 @@ class HttpParserTest < Test::Unit::TestCase # then that large mangled field values are caught 10.times do |c| get = "GET /#{rand_data(10,120)} HTTP/1.1\r\nX-Test: #{rand_data(1024, 1024+(c*1024), false)}\r\n\r\n" - assert_raises Unicorn::HttpParserError do + assert_raises(Unicorn::HttpParserError,Unicorn::RequestURITooLongError) do parser.buf << get parser.parse parser.clear -- cgit v1.2.3-24-ge0c7