Skip to main content

encode_headers

Function encode_headers 

Source
pub fn encode_headers(headers: &HeaderMap) -> Vec<u8> 
Expand description

Encode a response’s headers into the opaque blob that the store persists. Format: little-endian length-prefixed (name, value) pairs. Header values can carry arbitrary bytes (per RFC 9110 they may include any opaque-data octet, with the exception of CR/LF), so a binary blob is the only correct representation — JSON would force lossy UTF-8 coercion on values like opaque ETag tokens that may already be quoted-string blobs.