Skip to content

Commit

Permalink
feat: use non-zero ports resolved by dns resolvers
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuhvi committed Sep 16, 2024
1 parent 4a8a261 commit 6bd153c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/client/legacy/connect/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,12 @@ where
.map_err(ConnectError::dns)?;
let addrs = addrs
.map(|mut addr| {
addr.set_port(port);
// Respect explicit ports in the URI,
// and non `0` ports resolved from a custom dns resolver.
if dst.port().is_some() || addr.port() == 0 {
addr.set_port(port)
};

addr
})
.collect();
Expand Down

0 comments on commit 6bd153c

Please sign in to comment.