mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
net: Suppress default ports in Origin header.
This commit is contained in:
parent
bf564cae5d
commit
27c25116d3
2 changed files with 7 additions and 8 deletions
|
@ -793,7 +793,11 @@ fn try_immutable_origin_to_hyper_origin(url_origin: &ImmutableOrigin) -> Option<
|
|||
match *url_origin {
|
||||
ImmutableOrigin::Opaque(_) => Some(HyperOrigin::NULL),
|
||||
ImmutableOrigin::Tuple(ref scheme, ref host, ref port) => {
|
||||
HyperOrigin::try_from_parts(&scheme, &host.to_string(), Some(port.clone())).ok()
|
||||
let port = match (scheme.as_ref(), port) {
|
||||
("http", 80) | ("https", 443) => None,
|
||||
_ => Some(*port),
|
||||
};
|
||||
HyperOrigin::try_from_parts(&scheme, &host.to_string(), port).ok()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue