From 52c2c6273e7c007543de776937a25827c27d0ff1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 3 Sep 2009 01:50:52 -0700 Subject: http: add HttpParser#headers? method This method determines if there are headers in the request. Simple HTTP/0.9 requests did not have headers in the request (and our responses we make should not have them, either). --- test/unit/test_http_parser_ng.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/unit/test_http_parser_ng.rb b/test/unit/test_http_parser_ng.rb index 9b86cd3..6b9c89d 100644 --- a/test/unit/test_http_parser_ng.rb +++ b/test/unit/test_http_parser_ng.rb @@ -21,6 +21,7 @@ class HttpParserNgTest < Test::Unit::TestCase assert_equal '123', req['CONTENT_LENGTH'] assert_equal 0, str.size assert ! @parser.keepalive? + assert @parser.headers? end def test_identity_oneshot_header @@ -299,6 +300,7 @@ class HttpParserNgTest < Test::Unit::TestCase "QUERY_STRING"=>"" } assert_equal expect, req + assert ! parser.headers? end end -- cgit v1.2.3-24-ge0c7