http: improve RFC 7230 conformance
commit193b968013462c2966d7175a0f509625e98830ea
authorEric Wong <bofh@yhbt.net>
Thu, 19 Mar 2020 02:28:23 +0000 (19 02:28 +0000)
committerEric Wong <bofh@yhbt.net>
Thu, 19 Mar 2020 08:22:27 +0000 (19 08:22 +0000)
tree816a43bdbd28565167b8a548bef49ca0083275e6
parentb6c62e1b80ae1282ef99b8b641486446aa438e31
http: improve RFC 7230 conformance

We need to favor "Transfer-Encoding: chunked" over
"Content-Length" in the request header if they both exist.
Furthermore, we now reject redundant chunking and cases where
"chunked" is not the final encoding.

We currently do not and have no plans to decode "gzip",
"deflate", or "compress" encoding as described by RFC 7230.
That's a job more appropriate for middleware, anyways.

cf. https://tools.ietf.org/html/rfc7230
    https://www.rfc-editor.org/errata_search.php?rfc=7230
ext/unicorn_http/unicorn_http.rl
lib/unicorn/http_request.rb
test/unit/test_http_parser_ng.rb