Skip to content

Commit

Permalink
Revert "fix: Return error on non https uri instead of panic (hyperium…
Browse files Browse the repository at this point in the history
…#838)"

This reverts commit ef6e245.
  • Loading branch information
Guiguiprim committed Jul 22, 2024
1 parent ff9b3ea commit b9e2ce0
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions tonic/src/transport/channel/service/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ where
} else {
Ok(BoxedIo::new(io))
};
} else if is_https {
return Err(HttpsUriWithoutTlsSupport(()).into());
}
}

Expand All @@ -95,19 +93,3 @@ where
})
}
}

/// Error returned when trying to connect to an HTTPS endpoint without TLS enabled.
#[cfg(feature = "tls")]
#[derive(Debug)]
pub(crate) struct HttpsUriWithoutTlsSupport(());

#[cfg(feature = "tls")]
impl fmt::Display for HttpsUriWithoutTlsSupport {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Connecting to HTTPS without TLS enabled")
}
}

// std::error::Error only requires a type to impl Debug and Display
#[cfg(feature = "tls")]
impl std::error::Error for HttpsUriWithoutTlsSupport {}

0 comments on commit b9e2ce0

Please sign in to comment.