Skip to content

Commit

Permalink
fix: ask for h2 iff the http2 feature is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
paolobarbolini committed Mar 20, 2024
1 parent 92aa28c commit 10b11c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/async_impl/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,11 @@ impl ClientBuilder {
tls.alpn_protocols = vec!["h3".into()];
}
HttpVersionPref::All => {
tls.alpn_protocols = vec!["h2".into(), "http/1.1".into()];
tls.alpn_protocols = vec![
#[cfg(feature = "http2")]
"h2".into(),
"http/1.1".into()
];
}
}

Expand Down

0 comments on commit 10b11c1

Please sign in to comment.