mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
#32024 broke a different set of nginx sites, and a more sophisticated fix for the case of a missing HTTP 1.1 `Host` header is required.
This commit is contained in:
parent
f5bdfdfe94
commit
7a507a4d5b
3 changed files with 1 additions and 25 deletions
|
@ -1225,20 +1225,7 @@ async fn http_network_or_cache_fetch(
|
|||
|
||||
// Step 5.16
|
||||
let current_url = http_request.current_url();
|
||||
if !http_request.headers.contains_key(header::HOST) {
|
||||
let host = if current_url.port().is_none() {
|
||||
current_url.host_str().unwrap().to_string()
|
||||
} else {
|
||||
format!(
|
||||
"{}:{}",
|
||||
current_url.host_str().unwrap(),
|
||||
current_url.port().unwrap()
|
||||
)
|
||||
};
|
||||
http_request.headers.typed_insert(headers::Host::from(
|
||||
host.parse::<http::uri::Authority>().unwrap(),
|
||||
));
|
||||
}
|
||||
http_request.headers.remove(header::HOST);
|
||||
|
||||
// unlike http_loader, we should not set the accept header
|
||||
// here, according to the fetch spec
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue