Skip to content

Commit 87108e0

Browse files
Nemo157algesten
authored andcommitted
Support both http 0.2 and 1.0
1 parent 89a69a5 commit 87108e0

7 files changed

Lines changed: 491 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ jobs:
5959
- native-certs
6060
- gzip
6161
- brotli
62+
- http
6263
- http-interop
64+
- http http-interop
6365
env:
6466
RUST_BACKTRACE: "1"
6567
RUSTFLAGS: "-D dead_code -D unused-variables -D unused"

Cargo.lock

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ cookies = ["dep:cookie", "dep:cookie_store"]
2525
socks-proxy = ["dep:socks"]
2626
gzip = ["dep:flate2"]
2727
brotli = ["dep:brotli-decompressor"]
28-
http-interop = ["dep:http"]
28+
http-interop = ["dep:http-02"]
29+
http = ["dep:http"]
2930
proxy-from-env = []
3031

3132
[dependencies]
@@ -46,6 +47,7 @@ rustls-native-certs = { version = "0.6", optional = true }
4647
native-tls = { version = "0.2", optional = true }
4748
flate2 = { version = "1.0.22", optional = true }
4849
brotli-decompressor = { version = "2.3.2", optional = true }
50+
http-02 = { package = "http", version = "0.2", optional = true }
4951
http = { version = "1.0", optional = true }
5052

5153
[dev-dependencies]

src/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub fn get_header<'h>(headers: &'h [Header], name: &str) -> Option<&'h str> {
158158
.and_then(|h| h.value())
159159
}
160160

161-
#[cfg(any(doc, all(test, feature = "http-interop")))]
161+
#[cfg(any(doc, all(test, any(feature = "http-interop", feature = "http"))))]
162162
pub fn get_header_raw<'h>(headers: &'h [Header], name: &str) -> Option<&'h [u8]> {
163163
headers
164164
.iter()

0 commit comments

Comments
 (0)