Skip to content

Commit

Permalink
apply it in the agent too
Browse files Browse the repository at this point in the history
  • Loading branch information
aviramha committed Jun 6, 2024
1 parent 0c8caf5 commit 19ff005
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mirrord/agent/src/steal/connections/filtered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl FilteringService {
/// Also, it does not retry the request upon failure.
async fn send_request(
to: SocketAddr,
request: Request<Incoming>,
mut request: Request<Incoming>,
) -> Result<Response<Incoming>, Box<dyn std::error::Error>> {
let tcp_stream = TcpStream::connect(to).await.inspect_err(|error| {
tracing::error!(?error, address = %to, "Failed connecting to request destination");
Expand All @@ -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
Expand Down

0 comments on commit 19ff005

Please sign in to comment.