Skip to content

Commit

Permalink
fix: Log bytes in also
Browse files Browse the repository at this point in the history
  • Loading branch information
gabotechs committed Nov 22, 2023
1 parent f8ced1c commit 5d5d96c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions server/src/route_gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl<T: SecretGetter> SignwayServer<T> {
}

let Some(host) = unverified_req.elements.proxy_url.host() else {
return Ok(bad_request("Invalid host in proxy url"))
return Ok(bad_request("Invalid host in proxy url"));
};
let host = host.to_string();

Expand All @@ -134,13 +134,13 @@ impl<T: SecretGetter> SignwayServer<T> {

info!("Id {id} provided a valid signature, redirecting the request...",);

let info = BytesTransferredInfo {
id: id.to_string(),
proxy_url: unverified_req.elements.proxy_url.clone(),
kind: BytesTransferredKind::Out,
};

if self.monitor_bytes {
let info = BytesTransferredInfo {
id: id.to_string(),
proxy_url: unverified_req.elements.proxy_url.clone(),
kind: BytesTransferredKind::In,
};

let (parts, body) = req.into_parts();
let body = self.monitor_body(body, info);
req = Request::from_parts(parts, body);
Expand All @@ -154,13 +154,13 @@ impl<T: SecretGetter> SignwayServer<T> {
return Ok(res);
};

let info = BytesTransferredInfo {
id: id.to_string(),
proxy_url: unverified_req.elements.proxy_url,
kind: BytesTransferredKind::Out,
};

if self.monitor_bytes {
let info = BytesTransferredInfo {
id: id.to_string(),
proxy_url: unverified_req.elements.proxy_url,
kind: BytesTransferredKind::Out,
};

let (parts, body) = res.into_parts();
let body = self.monitor_body(body, info);
res = Response::from_parts(parts, body);
Expand Down

0 comments on commit 5d5d96c

Please sign in to comment.