Permalink
Browse files

http: test case for "Connection: TE"

We need to be sure we don't barf on this header.
  • Loading branch information...
1 parent 68e8d37 commit cda82b5ff44c8fcfb61315f822bbaefa3471d4fe Eric Wong committed Dec 17, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/unit/test_http_parser_ng.rb
@@ -31,6 +31,14 @@ def test_keepalive_requests_setting
assert_raises(TypeError) { HttpParser.keepalive_requests = [] }
end
+ def test_connection_TE
+ @parser.buf << "GET / HTTP/1.1\r\nHost: example.com\r\nConnection: TE\r\n"
+ @parser.buf << "TE: trailers\r\n\r\n"
+ assert_nothing_raised { @parser.parse }
+ assert @parser.keepalive?
+ assert @parser.next?
+ end
+
def test_keepalive_requests_with_next?
req = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n".freeze
expect = {

0 comments on commit cda82b5

Please sign in to comment.