diff --git a/Cargo.lock b/Cargo.lock index d8ed8820..d3afb7f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1235,10 +1235,11 @@ dependencies = [ [[package]] name = "ureq-proto" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcec9cbfbf05a7feef00db0295c6183f468635c7adb12a31e941f3660b071bff" +checksum = "8029a181dbb48c63644ab8b38e6592349749efabcc52b7de5be34dca57c88eea" dependencies = [ + "base64", "http", "httparse", "log", diff --git a/Cargo.toml b/Cargo.toml index 93bd392e..b3a1d907 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.1" # 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() {