diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8168e194..3d6f86dc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,9 +59,9 @@ jobs: - native-certs - gzip - brotli - - http + - http-crate - http-interop - - http http-interop + - http-crate http-interop env: RUST_BACKTRACE: "1" RUSTFLAGS: "-D dead_code -D unused-variables -D unused" diff --git a/CHANGELOG.md b/CHANGELOG.md index f57368c0..6d5a66ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 2.9.1 + +## Fixed + + * Unbreak feature `http-interop`. This feature is version locked to http crate 0.2 + * New feature `http-crate`. This feature is for http crate 1.0 + * New feature `proxy-from-env` to detect proxy settings for global Agent (ureq::get). + # 2.9.0 ## Fixed diff --git a/Cargo.toml b/Cargo.toml index 1f1309b2..52699309 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,8 +25,11 @@ cookies = ["dep:cookie", "dep:cookie_store"] socks-proxy = ["dep:socks"] gzip = ["dep:flate2"] brotli = ["dep:brotli-decompressor"] +# http-interop is for http crate version 0.2 (backwards compat with last pre-release) +# Consider this feature deprecated. In time, we will remove it. Use `http-crate` instead. http-interop = ["dep:http-02"] -http = ["dep:http"] +# http-crate is for http crate version 1.0 (full release) +http-crate = ["dep:http"] proxy-from-env = [] [dependencies] diff --git a/src/header.rs b/src/header.rs index bc9f962c..ebc2ed1b 100644 --- a/src/header.rs +++ b/src/header.rs @@ -158,7 +158,7 @@ pub fn get_header<'h>(headers: &'h [Header], name: &str) -> Option<&'h str> { .and_then(|h| h.value()) } -#[cfg(any(doc, all(test, any(feature = "http-interop", feature = "http"))))] +#[cfg(any(doc, all(test, any(feature = "http-interop", feature = "http-crate"))))] pub fn get_header_raw<'h>(headers: &'h [Header], name: &str) -> Option<&'h [u8]> { headers .iter() diff --git a/src/http.rs b/src/http_crate.rs similarity index 100% rename from src/http.rs rename to src/http_crate.rs diff --git a/src/http_interop.rs b/src/http_interop.rs index 05a0eaa9..2864daa5 100644 --- a/src/http_interop.rs +++ b/src/http_interop.rs @@ -277,8 +277,8 @@ impl From for http::request::Builder { #[cfg(test)] mod tests { - use http_02 as http; use crate::header::{add_header, get_header_raw, HeaderLine}; + use http_02 as http; #[test] fn convert_http_response() { diff --git a/src/lib.rs b/src/lib.rs index fa97ae10..d6bafe9d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -419,10 +419,12 @@ mod test; mod testserver; #[cfg(feature = "http-interop")] +// 0.2 version dependency (deprecated) mod http_interop; -#[cfg(feature = "http")] -mod http; +#[cfg(feature = "http-crate")] +// 1.0 version dependency. +mod http_crate; pub use crate::agent::Agent; pub use crate::agent::AgentBuilder; diff --git a/test.sh b/test.sh index beaba418..d5fa3df0 100755 --- a/test.sh +++ b/test.sh @@ -4,7 +4,7 @@ set -eu export RUST_BACKTRACE=1 export RUSTFLAGS="-D dead_code -D unused-variables -D unused" -for feature in "" tls json charset cookies socks-proxy "tls native-certs" native-tls gzip brotli http-interop; do +for feature in "" tls json charset cookies socks-proxy "tls native-certs" native-tls gzip brotli http-interop http-crate; do if ! cargo test --no-default-features --features "${feature}" ; then echo Command failed: cargo test --no-default-features --features \"${feature}\" exit 1