code cleanup and improvements.

This commit is contained in:
Ara Sadoyan
2026-04-08 17:00:06 +02:00
parent 93a8661281
commit 389c12119a
5 changed files with 22 additions and 61 deletions

View File

@@ -70,7 +70,6 @@ impl ProxyHttp for LB {
let hostname = return_header_host_from_upstream(session, &self.ump_upst);
_ctx.hostname = hostname;
let mut backend_id = None;
if _ctx.extraparams.sticky_sessions {
if let Some(cookies) = session.req_header().headers.get("cookie") {
if let Ok(cookie_str) = cookies.to_str() {
@@ -239,7 +238,7 @@ impl ProxyHttp for LB {
let mut buf = buffer.borrow_mut();
buf.clear();
write!(buf, "{}", client_ip).unwrap_or(());
upstream_request.append_header("X-Forward-For", buf.as_str()).unwrap_or(false);
upstream_request.append_header("X-Forwarded-For", buf.as_str()).unwrap_or(false);
});
}