Implementing content-length header semantics plus tests.