From b096bf4806956600ab92339196efcfeee66e7f89 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 25 Mar 2017 16:53:25 +0100 Subject: [PATCH] Use Url::port instead of Url::port_or_known_default to set Host AFAIK, if there is no explicit port in the request URL, there should be no explicit port in the Host header. --- components/net/http_loader.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index 425f38f1e0e..ca972034471 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -907,7 +907,7 @@ fn http_network_or_cache_fetch(request: Rc, let headers = &mut *http_request.headers.borrow_mut(); let host = Host { hostname: current_url.host_str().unwrap().to_owned(), - port: current_url.port_or_known_default() + port: current_url.port() }; headers.set(host); // unlike http_loader, we should not set the accept header