Skip to main content

Module fields

Module fields 

Source
Expand description

Field names and values (RFC 9110 §5).

The grammar every version shares: a name is a token, a value is visible octets, spaces and tabs with none at either end. HTTP/2 and HTTP/3 add that names are lowercase and that connection-specific fields are malformed (CONNECTION_SPECIFIC); those rules live in their modules.

Structs§

Field
One field line as it arrived: the name as written (case preserved) and the value with surrounding whitespace removed.

Constants§

CONNECTION_SPECIFIC
The fields RFC 9113 §8.2.2 and RFC 9114 §4.2 call connection-specific: an HTTP/2 or HTTP/3 message that carries one is malformed, and an HTTP/1.1 library manages them itself rather than taking them from an application.

Functions§

is_connection_specific
Whether name is one of CONNECTION_SPECIFIC, ignoring ASCII case.
is_field_value
A field value (RFC 9110 §5.5): VCHAR, obs-text, SP and HTAB, no CR, LF or NUL, and no SP or HTAB at either end. The empty value is valid.
is_sensitive
Whether a field carries a credential an encoder must never put into a compression table, and a log must never print: authorization, proxy-authorization, cookie and set-cookie, compared ignoring ASCII case (RFC 7541 §7.1.3, RFC 9204 §7.1.3).
is_tchar
tchar (RFC 9110 §5.6.2).
is_token
A non-empty run of tchar: a field name or a method (RFC 9110 §5.6.2).
trim_ows
Strips SP and HTAB from both ends (RFC 9110 §5.5 OWS).