Skip to main content

Module url_guard

Module url_guard 

Source
Expand description

The origin of an address, asked through one guard.

A blob: address carries another address (blob:https://example.com/<id>), and its origin is the carried address’s. An address that carries another blob: address has no origin here: it is refused, so the answer is “no origin”, and every caller treats that as “not allowed”. Every place that decides something from an address’s origin asks through checked_origin (or origin_string), never through Url::origin directly.

Functions§

checked_origin
url’s origin, or None for an address this guard refuses (a nested blob: address).
is_nested_blob
Whether url is a blob: address whose carried address is itself a blob: address.
origin_string
checked_origin as scheme://host[:port] (null for an opaque origin), or None for a refused address.