Skip to content

Commit

Permalink
Add BASIC auth from URI
Browse files Browse the repository at this point in the history
  • Loading branch information
algesten committed Jan 3, 2025
1 parent 2c2af87 commit 2dba99c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2dba99c

Please sign in to comment.