Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Content-Length header set to 0 in HEAD requests #659
I g-have a problem with HEAD requests : mitmproxy override Content-Length header and set it to 0.
I looked in the code and I saw that the Content-Length is computed from the length of the body of the request. Or HEAD requests have no body but can have a Content-Length > 0.
I don't know how to fix the bug but if anyone has a solution, I would be happy.
Thanks for the report - I think we don't consider yet that there are responses whose actual content length is not equal to
We currently always set the content-length to the correct value at http.py#L803-L806. I'm afraid we need to get rid of that, which should be done very carefully as quite a few features depend on that.
On 0.15 I am still getting 0 as Content-Lenght on HEAD requests.
curl -i -X HEAD http://vid.applovin.com/1428106347_x.mp4