http: pedantic fix for trailer-less chunked requests
commitc54df54f6633f3467b64fdfc9cbff278d02397ac
authorEric Wong <normalperson@yhbt.net>
Mon, 26 Apr 2010 22:02:46 +0000 (26 15:02 -0700)
committerEric Wong <normalperson@yhbt.net>
Mon, 26 Apr 2010 22:08:10 +0000 (26 15:08 -0700)
tree86481f48c3f247446fe9b1ef8f1b592ba1a0728f
parentde0e3a2f969730f4682daf6cff1e0d424ddd43e1
http: pedantic fix for trailer-less chunked requests

HTTP requests without trailers still need a CRLF after the last
chunk, that is: it must end as: "0\r\n\r\n", not "0\r\n".  So
we'll always pretend there are trailers to parse for the
sake of TeeInput.

This is mostly a pedantic fix, as the two bytes in the socket
buffer are unlikely to trigger protocol errors.
ext/unicorn_http/unicorn_http.rl
test/unit/test_http_parser_ng.rb
test/unit/test_tee_input.rb