Skip to main content

Module headers

Module headers 

Source
Expand description

Escaping for free-form values carried in HTTP headers.

HTTP header values carry only visible ASCII, so any value that may contain arbitrary Unicode — an object key, a filename, a custom metadata value — has to be escaped to survive the transport. This module owns that escaping for the whole workspace: it is the only place that depends on [percent_encoding], so callers escape by name rather than by assembling a character set of their own.

Encoding is a property of the transport, never of the value: everything in memory holds the logical string, and encode_header_value is applied only when writing a header.

Structs§

ExtValue
A logical string wrapped for use as an RFC 8187 ext-value, in header parameters like Content-Disposition’s filename*.

Enums§

DecodeError
The reasons a header value can fail to decode into a logical string.

Functions§

decode_header_str
Decodes an escaped string back into its logical form.
decode_header_value
Decodes a header value into the logical string it carries.
encode_header_str
Escapes a logical string for a transport that is not an HTTP header.
encode_header_value
Escapes a logical string into a header value.