diff --git a/CHANGELOG.md b/CHANGELOG.md index abbf1d73..1938d154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased + * Handle Authorization: Basic from URI (#923) + # 3.0.0-rc4 * Default to `TooManyRedirects` error (#916) diff --git a/Cargo.lock b/Cargo.lock index d8ed8820..1c4125bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1235,10 +1235,11 @@ dependencies = [ [[package]] name = "ureq-proto" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcec9cbfbf05a7feef00db0295c6183f468635c7adb12a31e941f3660b071bff" +checksum = "f76790855073cbbdf9a23a7a622741480cebaec1d9b9b06b6ed2c55611fed37c" dependencies = [ + "base64", "http", "httparse", "log", diff --git a/Cargo.toml b/Cargo.toml index 93bd392e..f843386c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ _test = [] [dependencies] base64 = "0.22.1" -ureq-proto = "0.2.0" +ureq-proto = "0.2.2" # ureq-proto = { path = "../ureq-proto" } log = "0.4.22" once_cell = "1.19.0" diff --git a/src/lib.rs b/src/lib.rs index f8feba1e..a3b5829b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -813,6 +813,15 @@ pub(crate) mod test { .expect("to send correctly"); } + #[test] + #[cfg(not(feature = "_test"))] + fn username_password_from_uri() { + init_test_log(); + let mut res = get("https://martin:secret@httpbin.org/get").call().unwrap(); + let body = res.body_mut().read_to_string().unwrap(); + assert!(body.contains("Basic bWFydGluOnNlY3JldA==")); + } + #[test] #[cfg(all(feature = "cookies", feature = "_test"))] fn store_response_cookies() {