[HTTP-Proxy] Content-Lenth vs Transer-Encoding: chunked

arved at arved.at arved at arved.at
Mon Dec 18 14:48:37 CET 2023


Salut List,

I think there is a bug in HTTP::Proxy.pm.

If there is no response body filter configured, "will_modify" is not set.
If will_modify is not set "Content-Length" header is not removed (Line 511)

But in Line 536 "Transfer-Encoding: chunked" is added.

This results in an invalid HTTP Response as per RFC:

   A sender MUST NOT send a Content-Length header field in any message
   that contains a Transfer-Encoding header field.


My suggestion is to add "$response->remove_header("Content-Length");" at line 
536. 

Best regards,
tilman







More information about the HTTP-Proxy mailing list