ruma

Module http_headers

Source
Expand description

Helpers for HTTP headers.

Structs§

ContentDisposition
The value of a Content-Disposition HTTP header.
TokenString
A non-empty string consisting only of tokens as defined in [RFC 9110 Section 3.2.6].

Enums§

ContentDispositionParseError
An error encountered when trying to parse an invalid ContentDisposition.
ContentDispositionType
A disposition type in the Content-Disposition HTTP header as defined in Section 4.2 of RFC 6266.
TokenStringParseError
The parsed string contains a character not allowed for a TokenString.

Functions§

is_ascii_string_quotable
Whether the given char is in the US-ASCII character set and allowed inside a quoted string.
is_tchar
Whether the given byte is a token char.
is_token
Whether the given bytes slice is a token.
is_token_string
Whether the given string is a token.
is_vchar
Whether the given char is a visible US-ASCII char.
quote_ascii_string_if_required
If the US-ASCII field value does not contain only token chars, convert it to a quoted string.
sanitize_for_ascii_quoted_string
Remove characters that do not pass is_ascii_string_quotable() from the given string.
unescape_string
Removes the escape backslashes in the given string.