Skip to main content

url_origin

Function url_origin 

Source
pub fn url_origin(url: &str) -> Option<String>
Expand description

The origin of an absolute URL: scheme://host[:port] in lowercase, without user info or a default port, and with a websocket’s scheme as the page’s (ws as http, wss as https), so a socket and a page on one server have one origin. None for anything else, including a URL with a backslash, a control character or white space: a browser reads those otherwise (\ is / to it, so ws://evil\@server/ is a socket to evil).