diff --git a/server/src/route_gateway.rs b/server/src/route_gateway.rs index 1b93ffe..675be13 100644 --- a/server/src/route_gateway.rs +++ b/server/src/route_gateway.rs @@ -110,7 +110,7 @@ impl SignwayServer { } 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(); @@ -134,13 +134,13 @@ impl SignwayServer { 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); @@ -154,13 +154,13 @@ impl SignwayServer { 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);