headers
headers copied to clipboard
Origin::try_from_parts shouldn't include default port values
If the scheme is http and the port is 80, or https and 443, the port should not be included by default. Per testing in https://github.com/servo/servo/issues/22090#issuecomment-443602332 this is not web compatible.
On the other hand, I guess this can be dealt with by the caller by passing a None value for the port when desired.
Would it be expected that the "default" port is just thrown away? For instance:
let origin = Origin::try_from_parts("https", "duckduckgo.com", 443).unwrap();
// Which should be correct?
assert_eq!(origin.port(), Some(443));
assert_eq!(origin.port(), None);
Since the argument can be passed explicitly, part of me thinks it'd be more confusing if the port sometimes wasn't included.
Would it be expected that the "default" port is just thrown away?
That's what rust-url does, so yes.