]> Sergey Matveev's repositories - public-inbox.git/commit
http: fix RFC conformance w.r.t. message length
authorEric Wong <e@yhbt.net>
Tue, 17 Mar 2020 06:52:17 +0000 (06:52 +0000)
committerEric Wong <e@yhbt.net>
Thu, 19 Mar 2020 06:45:32 +0000 (06:45 +0000)
commitfa19cdc57074e6efeec2379f2b4e8d14f71773e4
treec9f237e8fc5e2146c4403e5bb45ee26063f033d2
parenta93dcadf3ead60189ed9cfcac536c8de8b08a961
http: fix RFC conformance w.r.t. message length

We need to favor "Transfer-Encoding: chunked" over the value of
the Content-Length header.  We should also reject bogus,
duplicate and/or unreasonable values for both these, since they
can trigger unexpected behavior when combined with other HTTP
parsers in proxies such as varnish, nginx, haproxy, etc...

See RFC 7230 (and RFC 2616) for more details:

https://tools.ietf.org/html/rfc7230
https://www.rfc-editor.org/errata_search.php?rfc=7230
lib/PublicInbox/HTTP.pm
t/httpd-corner.t