From 19ff00564640496ec10648c7a4d95be10a20d4d6 Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Thu, 6 Jun 2024 12:15:24 +0300 Subject: [PATCH] apply it in the agent too --- mirrord/agent/src/steal/connections/filtered.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mirrord/agent/src/steal/connections/filtered.rs b/mirrord/agent/src/steal/connections/filtered.rs index 3fd7a4cb27d..9dcc16b39e9 100644 --- a/mirrord/agent/src/steal/connections/filtered.rs +++ b/mirrord/agent/src/steal/connections/filtered.rs @@ -117,7 +117,7 @@ impl FilteringService { /// Also, it does not retry the request upon failure. async fn send_request( to: SocketAddr, - request: Request, + mut request: Request, ) -> Result, Box> { let tcp_stream = TcpStream::connect(to).await.inspect_err(|error| { tracing::error!(?error, address = %to, "Failed connecting to request destination"); @@ -142,6 +142,12 @@ impl FilteringService { } }); + // fixes https://github.com/metalbear-co/mirrord/issues/2497 + // inspired by https://github.com/linkerd/linkerd2-proxy/blob/c5d9f1c1e7b7dddd9d75c0d1a0dca68188f38f34/linkerd/proxy/http/src/h2.rs#L175 + if request.uri().authority().is_none() { + *request.version_mut() = hyper::http::Version::HTTP_11; + } + request_sender .send_request(request) .await