Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DuckDuckGo HTML search #22354

Merged
merged 3 commits into from Dec 22, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

net: Suppress default ports in Origin header.

  • Loading branch information
jdm committed Dec 17, 2018
commit 27c25116d3ad26cb4ba70f94da45818ec823ff72
@@ -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()
},
}
}
@@ -1450,13 +1450,8 @@ fn test_origin_set() {
);

let origin_url = ServoUrl::parse("http://example.com").unwrap();
// XXX: Not sure about the Some(80) here. origin_url.origin() returns 80 for the port but origin_url returns None.
origin = Origin::try_from_parts(
origin_url.scheme(),
origin_url.host_str().unwrap(),
Some(80),
)
.unwrap();
origin =
Origin::try_from_parts(origin_url.scheme(), origin_url.host_str().unwrap(), None).unwrap();
// Test Origin header is set on Get request with CORS mode
let mut request = Request::from_init(RequestInit {
url: url.clone(),
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.