No, there is the case where you have `Transfer-Encoding: identity`. Full quote:

Messages MUST NOT include both a Content-Length header field and a non-identity transfer-coding. If the message does include a non- identity transfer-coding, the Content-Length MUST be ignored.

So you use parse_header on transfer-encoding, and if it returns anything other than plain identity, you fail, otherwise you check the length.