diff options
Diffstat (limited to 'vendor/gix-url/src/parse.rs')
-rw-r--r-- | vendor/gix-url/src/parse.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vendor/gix-url/src/parse.rs b/vendor/gix-url/src/parse.rs index df5ad5565..bb9c1f38b 100644 --- a/vendor/gix-url/src/parse.rs +++ b/vendor/gix-url/src/parse.rs @@ -66,10 +66,12 @@ fn has_no_explicit_protocol(url: &[u8]) -> bool { } fn to_owned_url(url: url::Url) -> Result<crate::Url, Error> { + let password = url.password(); Ok(crate::Url { serialize_alternative_form: false, scheme: str_to_protocol(url.scheme()), - user: if url.username().is_empty() { + password: password.map(ToOwned::to_owned), + user: if url.username().is_empty() && password.is_none() { None } else { Some(url.username().into()) |