Origin¶
The origin of a URL: whether it is secure (https), the host, and the port.
Two requests share an origin when all three match. Host comparison is case-insensitive; the host is lowercased on construction. Redirect header stripping uses origin equality — credentials are removed when a hop crosses to a different origin.
Implements¶
- Equatable[Origin val] ref
- Stringable box
Constructors¶
create¶
Parameters¶
Returns¶
- Origin val^
from_uri¶
Extract the origin from a parsed URI. The host is lowercased and IPv6 brackets are stripped; the port defaults to 443 (https) or 80 (http) when the URI omits it. When the URI has no authority, host is empty.
Parameters¶
- url: URI val
Returns¶
- Origin val^
Public fields¶
let secure: Bool val¶
let host: String val¶
let port: String val¶
Public Functions¶
eq¶
Parameters¶
- that: Origin box
Returns¶
- Bool val
string¶
Returns¶
- String iso^
ne¶
Parameters¶
- that: Origin val
Returns¶
- Bool val