Update
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-11-26 12:20:10 +01:00
parent 8b613a1b6f
commit 21fab535d4

View File

@@ -17,7 +17,10 @@ struct Args {
#[arg(short, long, env, default_value = "x-target-host")]
target_host_port_header: String,
/// Name of optional header that contains path to add to the request
/// Name of optional header that contains path to add to the request.
///
/// If this value is defined, all clients packets are inspected in research for path to
/// manipulate
#[arg(short, long, env)]
path_prefix_header: Option<String>,
}
@@ -125,6 +128,14 @@ async fn main() -> Result<(), Box<dyn Error>> {
break;
}
// In case of connection reuse, we need to reanalyze data
if ARGS.path_prefix_header.is_some() &&
let Ok(Some(res))= process_headers(&buf_client[..count])
&& let Err(e) = upstream.write_all(&res.buff).await {
log::error!("[{conn_id}] Failed to write to upstream! {e}");
break;
}
if let Err(e)=upstream.write_all(&buf_client[..count]).await {
log::error!("[{conn_id}] Failed to write to upstream! {e}");
break;