limit upgrade only for http1.1 request

This commit is contained in:
Jun Kurihara 2023-12-15 16:29:51 +09:00
commit 1c1b50d213
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
3 changed files with 13 additions and 4 deletions

View file

@ -177,8 +177,11 @@ where
.headers_mut()
.insert(header::CONNECTION, HeaderValue::from_static("upgrade"));
}
if upgrade.is_none() {
// can update request line i.e., http version, only if not upgrade (http 1.1)
update_request_line(req, upstream_chosen, upstream_candidates)?;
}
update_request_line(req, upstream_chosen, upstream_candidates)?;
Ok(context)
}