about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-06-15 00:08:03 +0000
committerEric Wong <normalperson@yhbt.net>2011-06-15 00:13:36 +0000
commit742c4d77f179a757dbcb1fa350f9d75b757acfc7 (patch)
tree65b28a7aee34b4367cc5c8bc1a684c288c07a64a
parent20c0f28cf60f164c9788b694625bce22962464f3 (diff)
downloadunicorn-742c4d77f179a757dbcb1fa350f9d75b757acfc7.tar.gz
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.
-rw-r--r--test/unit/test_http_parser.rb4
1 files 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