Skip to content

Commit

Permalink
only add http version when it enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Jul 19, 2023
1 parent 8bf1528 commit 664a6ca
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/core/src/conn/acme/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,11 @@ where
.iter()
.map(|h| {
let mut versions = h.http_versions.clone();
#[cfg(feature = "http1")]
if !versions.contains(&Version::HTTP_11) {
versions.push(Version::HTTP_11);
}
#[cfg(feature = "http2")]
if !versions.contains(&Version::HTTP_2) {
versions.push(Version::HTTP_2);
}
Expand Down
2 changes: 2 additions & 0 deletions crates/core/src/conn/native_tls/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ where
.iter()
.map(|h| {
let mut versions = h.http_versions.clone();
#[cfg(feature = "http1")]
if !versions.contains(&Version::HTTP_11) {
versions.push(Version::HTTP_11);
}
#[cfg(feature = "http2")]
if !versions.contains(&Version::HTTP_2) {
versions.push(Version::HTTP_2);
}
Expand Down
2 changes: 2 additions & 0 deletions crates/core/src/conn/openssl/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ where
.iter()
.map(|h| {
let mut versions = h.http_versions.clone();
#[cfg(feature = "http1")]
if !versions.contains(&Version::HTTP_11) {
versions.push(Version::HTTP_11);
}
#[cfg(feature = "http2")]
if !versions.contains(&Version::HTTP_2) {
versions.push(Version::HTTP_2);
}
Expand Down
2 changes: 2 additions & 0 deletions crates/core/src/conn/rustls/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ where
.iter()
.map(|h| {
let mut versions = h.http_versions.clone();
#[cfg(feature = "http1")]
if !versions.contains(&Version::HTTP_11) {
versions.push(Version::HTTP_11);
}
#[cfg(feature = "http2")]
if !versions.contains(&Version::HTTP_2) {
versions.push(Version::HTTP_2);
}
Expand Down

0 comments on commit 664a6ca

Please sign in to comment.