Skip to content

Commit

Permalink
refactor(http client): use HTTP connector on http URLs (#1187)
Browse files Browse the repository at this point in the history
The HTTP connector is much faster than the HTTPs connector so
if the URL is a `http:://<....>` let's us it.

This can be enforced by disabling the TLS feature but as
it's part of the default features, it worth having.
  • Loading branch information
niklasad1 authored Aug 17, 2023
1 parent 7d924ff commit 9d153e7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions client/http-client/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@ where
url.set_fragment(None);

let client = match url.scheme() {
#[cfg(not(feature = "__tls"))]
"http" => HttpBackend::Http(Client::new()),
#[cfg(feature = "__tls")]
"https" | "http" => {
"https" => {
let connector = match cert_store {
#[cfg(feature = "native-tls")]
CertificateStore::Native => hyper_rustls::HttpsConnectorBuilder::new()
Expand Down

0 comments on commit 9d153e7

Please sign in to comment.