headers
headers copied to clipboard
feat: `Referer` Header add structured URI parsing and RFC-compliant validation
Gave some love to the Referer header while respecting RFC7231 spec.
Usage
let referer = Referer::from_str("https://example.com:8443/api/users?page=1").unwrap();
assert_eq!(referer.scheme(), Some("https"));
assert_eq!(referer.hostname(), Some("example.com"));
assert_eq!(referer.path(), "/api/users");
assert_eq!(referer.query(), Some("page=1"));
Woops forgot to format. Now should be good 😄
Note: RFC7231 was obsoleted by RFC9110.
Note: RFC7231 was obsoleted by RFC9110.
Referer specs are the same in both RFCs