Open
Description
Trying to parse a URL with an empty password will (incorrectly?) have password
be set to None. However if you set password to Some("")
, then call url.to_string()
, then the password separator in the url will be set. parse
and to_string
will fail to round trip in this edge case.
let mut url = match reqwest::Url::parse("rtsp://administrator:@google.com/") {
Ok(u) => u,
Err(err) => {
println!("'{}': {}", url, err);
return;
}
};
assert_eq!(url.password(), Some("")); // fails
url.set_password(Some(""));
assert_eq!(url.to_string(), "rtsp://administrator:@google.com/"); // passes
Metadata
Metadata
Assignees
Labels
No labels