From 066226e97c1a08f927f62ae50d7e95a9ada4f303 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 29 Mar 2009 19:01:24 -0700 Subject: http11: use :http_body instead of "HTTP_BODY" "HTTP_BODY" could conflict with a "Body:" HTTP header if there ever is one. Also, try to hide this body from the Rack environment before @app is called since it is only used by Unicorn internally. --- test/unit/test_http_parser.rb | 4 ++-- test/unit/test_request.rb | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/unit/test_http_parser.rb b/test/unit/test_http_parser.rb index 1deeaa2..57c8db2 100644 --- a/test/unit/test_http_parser.rb +++ b/test/unit/test_http_parser.rb @@ -113,7 +113,7 @@ class HttpParserTest < Test::Unit::TestCase assert_equal 'PUT', req['REQUEST_METHOD'] assert_equal 'HTTP/1.0', req['HTTP_VERSION'] assert_equal 'HTTP/1.1', req['SERVER_PROTOCOL'] - assert_equal "abcde", req['HTTP_BODY'] + assert_equal "abcde", req[:http_body] end def test_put_body_later @@ -126,7 +126,7 @@ class HttpParserTest < Test::Unit::TestCase assert_equal 'PUT', req['REQUEST_METHOD'] assert_equal 'HTTP/1.0', req['HTTP_VERSION'] assert_equal 'HTTP/1.1', req['SERVER_PROTOCOL'] - assert_equal "", req['HTTP_BODY'] + assert_equal "", req[:http_body] end def test_fragment_in_uri diff --git a/test/unit/test_request.rb b/test/unit/test_request.rb index 37fbb14..7a4b92b 100644 --- a/test/unit/test_request.rb +++ b/test/unit/test_request.rb @@ -50,6 +50,7 @@ class RequestTest < Test::Unit::TestCase "abcde") res = env = nil assert_nothing_raised { env = @request.read(client) } + assert ! env.include?(:http_body) assert_nothing_raised { res = @lint.call(env) } end @@ -71,6 +72,7 @@ class RequestTest < Test::Unit::TestCase assert_equal 0, client.sysseek(0) res = env = nil assert_nothing_raised { env = @request.read(client) } + assert ! env.include?(:http_body) assert_equal length, env['rack.input'].size count.times { assert_equal buf, env['rack.input'].read(bs) } assert_nil env['rack.input'].read(bs) -- cgit v1.2.3-24-ge0c7