Responses to the HEAD request method (Section 4.3.2 of [RFC7231]) never include a message body because the associated response header fields (e.g., Transfer-Encoding, Content-Length, etc.), if present, indicate only what their values would have been if the request method had been GET
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.
Looks like you "currently always set the content-length to the correct value" again but now its at message.py#L69-L70. I have no idea what the right way to fix it is but for my testing, I don't need those two lines and so I removed them.