fix: fix conversion flow of http version in requests to upstream app servers
This commit is contained in:
parent
88f1a5b008
commit
eea4f28c56
1 changed files with 9 additions and 12 deletions
|
|
@ -363,19 +363,16 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not specified (force_httpXX_upstream) and https, version is preserved except for http/3
|
// If not specified (force_httpXX_upstream) and https, version is preserved except for http/3
|
||||||
match req.version() {
|
if upstream_chosen.uri.scheme() == Some(&Scheme::HTTP) {
|
||||||
Version::HTTP_3 => {
|
// Change version to http/1.1 when destination scheme is http
|
||||||
debug!("HTTP/3 is currently unsupported for request to upstream.");
|
debug!("Change version to http/1.1 when destination scheme is http.");
|
||||||
*req.version_mut() = Version::HTTP_2;
|
*req.version_mut() = Version::HTTP_11;
|
||||||
}
|
} else if req.version() == Version::HTTP_3 {
|
||||||
_ => {
|
// HTTP/3 is always https
|
||||||
if upstream_chosen.uri.scheme() == Some(&Scheme::HTTP) {
|
debug!("HTTP/3 is currently unsupported for request to upstream.");
|
||||||
// Change version to http/1.1 when destination scheme is http
|
*req.version_mut() = Version::HTTP_2;
|
||||||
debug!("Change version to http/1.1 when destination scheme is http.");
|
|
||||||
*req.version_mut() = Version::HTTP_11;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply_upstream_options_to_request_line(req, upstream_group)?;
|
apply_upstream_options_to_request_line(req, upstream_group)?;
|
||||||
|
|
||||||
Ok(context)
|
Ok(context)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue