about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-09-06 14:29:57 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-06 14:31:37 -0700
commit1b1029efa7089a8a3628286fe006b1fc1ae8601e (patch)
treea5d5ec3ac6eb82989809447100a61ba2ef1cbb02 /test
parent2213d73a2d23bb39e8a4fa82a33d03daf4c39df2 (diff)
downloadunicorn-1b1029efa7089a8a3628286fe006b1fc1ae8601e.tar.gz
This probably doesn't affect anyone with HTTP/1.1, but
future versions of HTTP will use absolute URIs and maybe
we'll eventually get clients that (mistakenly) send us
Host: headers along with absolute URIs.
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_http_parser.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/test_http_parser.rb b/test/unit/test_http_parser.rb
index 5ba0239..7475de5 100644
--- a/test/unit/test_http_parser.rb
+++ b/test/unit/test_http_parser.rb
@@ -180,6 +180,17 @@ class HttpParserTest < Test::Unit::TestCase
     assert_equal 'hi y x ASDF', req['HTTP_X_ASDF']
   end
 
+  def test_continuation_with_absolute_uri_and_ignored_host_header
+    parser = HttpParser.new
+    header = "GET http://example.com/ HTTP/1.1\r\n" \
+             "Host: \r\n" \
+             "    YHBT.net\r\n" \
+             "\r\n"
+    req = {}
+    assert_equal req, parser.headers(req, header)
+    assert_equal 'example.com', req['HTTP_HOST']
+  end
+
   # this may seem to be testing more of an implementation detail, but
   # it also helps ensure we're safe in the presence of multiple parsers
   # in case we ever go multithreaded/evented...