Skip to content

Commit

Permalink
Handle basic auth from URI
Browse files Browse the repository at this point in the history
  • Loading branch information
algesten committed Jan 4, 2025
1 parent 58af416 commit 9398f48
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

* Handle Authorization: Basic from URI (#923)

# 3.0.0-rc4

* Default to `TooManyRedirects` error (#916)
Expand Down
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.2"
# 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:[email protected]/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 9398f48

Please sign in to comment.