about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-03-29 19:01:24 -0700
committerEric Wong <normalperson@yhbt.net>2009-03-29 20:59:52 -0700
commit066226e97c1a08f927f62ae50d7e95a9ada4f303 (patch)
tree5f1fafb16ed79427a2df4c136fe9f31efc73ac98 /test
parentdf58b5249c3e17ee4fab448224e3f043a2444fa0 (diff)
downloadunicorn-066226e97c1a08f927f62ae50d7e95a9ada4f303.tar.gz
"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.
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_http_parser.rb4
-rw-r--r--test/unit/test_request.rb2
2 files changed, 4 insertions, 2 deletions
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)