If the the response is chunk-encoded, ignore the Content-Length
authorFabian Keil <fk@fabiankeil.de>
Sat, 20 Mar 2021 13:05:44 +0000 (14:05 +0100)
committerFabian Keil <fk@fabiankeil.de>
Sun, 21 Mar 2021 07:30:52 +0000 (08:30 +0100)
commit44658fd0a890da746973eeee3fa07933797ae620
treeaf09d69a1cbc1d9bbb924f21b42607127893a209
parent5cd7e8def9afd797598c75dbb037f748bb5827e2
If the the response is chunk-encoded, ignore the Content-Length

... header sent by the server.

Allows to load https://redmine.lighttpd.net/ with filtering enabled.

Previously requests would fail with complaints like:

   2021-03-20 14:02:08.924 619000011880 Connect: Done reading from server. Expected content length: 7235. Actual content length: 7243. Bytes most recently read: 8130.
   2021-03-20 14:02:08.924 619000011880 Re-Filter: Need to de-chunk first
   2021-03-20 14:02:08.924 619000011880 Error: Not enough room for trailing CRLF.
   2021-03-20 14:02:08.925 619000011880 Connect: Received 7243 bytes while expecting 7235.
   2021-03-20 14:02:08.925 619000011880 Connect: Marking the server socket 8 tainted.

Privoxy would then forward a partialy de-chunked response with
trailing garbage without removing the Transfer-Encoding header.
parsers.c