pub fn parse_origin(value: &[u8]) -> Result<OriginValue<'_>, ParseError>Expand description
Parses an Origin value.
null is case-sensitive. The scheme is a letter followed by letters,
digits, +, -, or .; the host follows the Host rules and may not
be empty; a path, query, fragment, trailing /, userinfo, or empty port
is refused.
§Errors
ErrorKind::InvalidOrigin; the Host errors for the host part.
§Examples
use parse_net::{parse_origin, OriginValue};
assert_eq!(parse_origin(b"null")?, OriginValue::Null);
assert!(parse_origin(b"Null").is_err());