Skip to content

Commit

Permalink
http: test case for "Connection: TE"
Browse files Browse the repository at this point in the history
We need to be sure we don't barf on this header.
  • Loading branch information
Eric Wong committed Dec 17, 2011
1 parent 68e8d37 commit cda82b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/unit/test_http_parser_ng.rb
Expand Up @@ -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 = {
Expand Down

0 comments on commit cda82b5

Please sign in to comment.