Skip to content

Commit

Permalink
use set password
Browse files Browse the repository at this point in the history
  • Loading branch information
rawdaGastan committed Oct 16, 2023
1 parent a665697 commit 6af37b7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ pub async fn pack<P: Into<PathBuf>, S: Store>(writer: Writer, store: S, root: P,
let mut store_url = route.url;

if strip_password {
let url = url::Url::parse(&store_url).expect("failed to parse store url");
let username = url.username();
let password = url.password().unwrap();
let stripped = format!("{}:{}@", username, password);
store_url = str::replace(&store_url, &stripped, "");
let mut url = url::Url::parse(&store_url).expect("failed to parse store url");
url.set_password(Some("")).expect("failed to remove password from url");
store_url = url.to_string();
}

writer
Expand Down

0 comments on commit 6af37b7

Please sign in to comment.