// Trailing spaces are removed
let mut a = url::Url::parse("a: ").unwrap();
// But Url::set_path doesn't
a.set_path(" ");
// Which breaks roundtripping.
assert_ne!(url::Url::parse(a.as_str()).unwrap(), url);
// And makes setting the query/fragment to themselves not no-ops.
a.set_query(None);
assert_eq!(a.as_str(), "a:");
See whatwg/url#909 for discussion on if setting the state override to opaque path is even valid.
I think the behavior should be to always replace a trailing space with %20. a: ? is already supposed to result in a: %20? (though currently doesn't...). AFAIK this should also remove the strip maybe trailing spaces code from the query and fragment setters.
See whatwg/url#909 for discussion on if setting the state override to opaque path is even valid.
I think the behavior should be to always replace a trailing space with
%20.a: ?is already supposed to result ina: %20?(though currently doesn't...). AFAIK this should also remove the strip maybe trailing spaces code from the query and fragment setters.