Skip to content

Commit

Permalink
fix(transport): Emit HttpsUriWithoutTlsSupport only w/ tls feat (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
guswynn authored May 4, 2022
1 parent 2e19b66 commit 1dd5ad2
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions tonic/src/transport/service/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,11 @@ where
#[cfg(feature = "tls-roots-common")]
let tls = self.tls_or_default(uri.scheme_str(), uri.host());

#[cfg(feature = "tls")]
let is_https = uri.scheme_str() == Some("https");
let connect = self.inner.make_connection(uri);

Box::pin(async move {
#[cfg(not(feature = "tls"))]
{
if is_https {
return Err(HttpsUriWithoutTlsSupport(()).into());
}
}

let io = connect.await?;

#[cfg(feature = "tls")]
Expand Down

0 comments on commit 1dd5ad2

Please sign in to comment.