diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-08-09 04:07:15 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-08-09 04:10:54 -0700 |
commit | b20dca2f1ab4b419bf496fb3212ce424b529ac2b (patch) | |
tree | 71c0dd711bdf383ebc07ca87e7239cc83517c451 /test | |
parent | 91150f18c4c7fe6ee912bb835ecaea001c322d30 (diff) | |
download | unicorn-b20dca2f1ab4b419bf496fb3212ce424b529ac2b.tar.gz |
Since Rack requires a Hash object, this is joined in in accordance with rfc2616, section 4.2[1]. Of course, it's up to the framework or application to handle such requests. I could optimize this to avoid creating a single garbage String object, but I don't think it's common enough to worry about... [1] - http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/test_http_parser_ng.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/test_http_parser_ng.rb b/test/unit/test_http_parser_ng.rb index 6fc0bda..8c453dd 100644 --- a/test/unit/test_http_parser_ng.rb +++ b/test/unit/test_http_parser_ng.rb @@ -252,4 +252,15 @@ class HttpParserNgTest < Test::Unit::TestCase assert_raise(HttpParserError) { @parser.trailers(req, str) } end + def test_repeat_headers + str = "PUT / HTTP/1.1\r\n" \ + "Trailer: Content-MD5\r\n" \ + "Trailer: Content-SHA1\r\n" \ + "transfer-Encoding: chunked\r\n\r\n" \ + "1\r\na\r\n2\r\n..\r\n0\r\n" + req = {} + assert_equal req, @parser.headers(req, str) + assert_equal 'Content-MD5,Content-SHA1', req['HTTP_TRAILER'] + end + end |