diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-04-21 11:14:39 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-04-21 11:16:21 -0700 |
commit | ed4f50016ab0eab1ebbeac2fe1d0fd8712c7ee91 (patch) | |
tree | 5c232a2f34271090ad6512d565ee2f3aee39e7af /test/unit/test_http_parser.rb | |
parent | 357fb0a21fdfe6ff3af522a2463248e20b2fa8be (diff) | |
download | unicorn-ed4f50016ab0eab1ebbeac2fe1d0fd8712c7ee91.tar.gz |
It's part of the HTTP/1.1 (rfc2616), so we might as well handle it in there and set PATH_INFO while we're at it. Also, make "OPTIONS *" test not fail Rack::Lint
Diffstat (limited to 'test/unit/test_http_parser.rb')
-rw-r--r-- | test/unit/test_http_parser.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/test_http_parser.rb b/test/unit/test_http_parser.rb index f6fdd47..37a539d 100644 --- a/test/unit/test_http_parser.rb +++ b/test/unit/test_http_parser.rb @@ -103,6 +103,20 @@ class HttpParserTest < Test::Unit::TestCase assert_nil req['QUERY_STRING'] end + def test_absolute_uri + parser = HttpParser.new + req = {} + http = "GET http://example.com/foo?q=bar HTTP/1.0\r\n\r\n" + assert parser.execute(req, http) + assert_equal 'http', req['rack.url_scheme'] + assert_equal '/foo?q=bar', req['REQUEST_URI'] + assert_equal '/foo', req['REQUEST_PATH'] + assert_equal 'q=bar', req['QUERY_STRING'] + + # assert_equal 'example.com', req['HTTP_HOST'] # TODO + # assert_equal 'example.com', req['SERVER_NAME'] # TODO + end + def test_put_body_oneshot parser = HttpParser.new req = {} |