exp
Some checks are pending
Unit Test / test (push) Waiting to run
ShiftLeft Scan / Scan-Build (push) Waiting to run

This commit is contained in:
ZettaScript 2025-10-13 15:25:15 +02:00
commit d9efeb42d6
11 changed files with 778 additions and 54 deletions

View file

@ -168,6 +168,12 @@ where
// can update request line i.e., http version, only if not upgrade (http 1.1)
update_request_line(req, upstream_chosen, upstream_candidates)?;
}
if let Some(set_host) = &upstream_candidates.set_host {
if let Some(host) = req.headers_mut().get_mut(&header::HOST) {
*host = HeaderValue::from_str(set_host).unwrap();
}
}
Ok(context)
}

View file

@ -371,7 +371,8 @@ pub(super) fn host_from_uri_or_host_header(uri: &Uri, host_header_value: Option<
// Prioritize uri host over host header
let uri_host = uri.host().map(|host| {
if let Some(port) = uri.port_u16() {
format!("{}:{}", host, port)
//format!("{}:{}", host, port)
host.to_string()
} else {
host.to_string()
}