From bd0599c4ac91d95cae1f34df3ae99c92f3225391 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 2 Sep 2009 23:49:05 -0700 Subject: http: SERVER_PROTOCOL matches HTTP_VERSION And it'll default to HTTP/0.9 if HTTP_VERSION is not specified (as version-less HTTP requests imply HTTP/0.9. --- test/unit/test_http_parser.rb | 6 +++--- test/unit/test_http_parser_ng.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/unit/test_http_parser.rb b/test/unit/test_http_parser.rb index 5430614..5ba0239 100644 --- a/test/unit/test_http_parser.rb +++ b/test/unit/test_http_parser.rb @@ -260,7 +260,7 @@ class HttpParserTest < Test::Unit::TestCase assert_equal 'HTTP/1.0', req['HTTP_VERSION'] assert_nil parser.headers(req, http << "\r") assert_equal req, parser.headers(req, http << "\n") - assert_equal 'HTTP/1.1', req['SERVER_PROTOCOL'] + assert_equal 'HTTP/1.0', req['SERVER_PROTOCOL'] assert_nil req['FRAGMENT'] assert_equal '', req['QUERY_STRING'] assert_equal "", http @@ -367,7 +367,7 @@ class HttpParserTest < Test::Unit::TestCase assert_equal '/', req['REQUEST_URI'] assert_equal 'PUT', req['REQUEST_METHOD'] assert_equal 'HTTP/1.0', req['HTTP_VERSION'] - assert_equal 'HTTP/1.1', req['SERVER_PROTOCOL'] + assert_equal 'HTTP/1.0', req['SERVER_PROTOCOL'] assert_equal "abcde", http assert ! parser.keepalive? # TODO: read HTTP/1.2 when it's final end @@ -381,7 +381,7 @@ class HttpParserTest < Test::Unit::TestCase assert_equal '/l', req['REQUEST_URI'] assert_equal 'PUT', req['REQUEST_METHOD'] assert_equal 'HTTP/1.0', req['HTTP_VERSION'] - assert_equal 'HTTP/1.1', req['SERVER_PROTOCOL'] + assert_equal 'HTTP/1.0', req['SERVER_PROTOCOL'] assert_equal "", http assert ! parser.keepalive? # TODO: read HTTP/1.2 when it's final end diff --git a/test/unit/test_http_parser_ng.rb b/test/unit/test_http_parser_ng.rb index f5b575b..9b86cd3 100644 --- a/test/unit/test_http_parser_ng.rb +++ b/test/unit/test_http_parser_ng.rb @@ -294,7 +294,7 @@ class HttpParserNgTest < Test::Unit::TestCase "PATH_INFO"=>"/read-rfc1945-if-you-dont-believe-me", "REQUEST_URI"=>"/read-rfc1945-if-you-dont-believe-me", "SERVER_PORT"=>"80", - "SERVER_PROTOCOL"=>"HTTP/1.1", # FIXME + "SERVER_PROTOCOL"=>"HTTP/0.9", "REQUEST_METHOD"=>"GET", "QUERY_STRING"=>"" } -- cgit v1.2.3-24-ge0c7