Skip to main content

Module data_url

Module data_url 

Source
Expand description

RFC 2397 data: URL parsing.

Rules: the scheme is matched case-insensitively; the first comma separates the header from the payload; a base64 parameter (case-insensitive) marks a base64 payload, which is percent-decoded, stripped of ASCII whitespace and decoded with padding optional; other payloads are percent-decoded; an empty media type defaults to text/plain;charset=US-ASCII; media type parameters other than base64 are kept.

Structs§

DataUrl
A parsed data: URL.

Constants§

DEFAULT_MEDIA_TYPE
Media type used when a data URL omits it.

Functions§

is_data_url
Returns true when input starts with the data: scheme.
parse
Parses a data: URL.