pub fn body_mode(head: &HttpHead) -> Result<HttpBodyMode, NetError>Expand description
Classify how the body should be read, matching the client’s precedence.
Extracted from sim-lib-agent-runner-http’s read_response:
Transfer-Encoding: chunked->HttpBodyMode::Chunked.- otherwise a present, non-zero
Content-Length->HttpBodyMode::ContentLength. - otherwise (no/zero length) ->
HttpBodyMode::UntilEof.
The client treated a missing or 0 Content-Length identically (read to
EOF), so a literal Content-Length: 0 maps to UntilEof here, not
HttpBodyMode::Empty. An invalid Content-Length is rejected.