mitmproxy/pathod — pull request #11 by mhils (2013-12-15 14:47:03+00:00)
Title: always return Content-Length: 0 if r is not set

Main PR: https://github.com/mitmproxy/netlib/pull/26

Always add a Content-Length header unless the raw flag is set. This is necessary for responses to be conformant to the [specs](http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-16#section-3.3):

6. Otherwise, this is a response message without a declared message-body length, so the message-body length is determined by the number of octets received prior to the server closing the connection.

pathod usually keeps the connection alive, so the requests would hang otherwise. After all, the Content-Length header can still be omitted by passing the r flag.