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.
This commit is contained in:
Anthony Ramine 2017-03-25 16:53:25 +01:00
parent 92c4a43946
commit b096bf4806

View file

@ -907,7 +907,7 @@ fn http_network_or_cache_fetch(request: Rc<Request>,
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