-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL with empty password is parsed as None #793
Comments
According to the reference URL parser I think setting the password to "" should be special cased instead, to ensure we don't get a different behaviour. |
FWIW, I believe that at least for http basic authentication, the absence of a password and an empty password are equivalent. |
Ok, interesting, the issue came up because we use this library for rtsp urls and the remote server was treating the absence of a password and an empty password differently. The fact that the round trip from Can I assume this is probably a |
Accordingly to standard (https://url.spec.whatwg.org/#url-representation) when the url does not have a password we should get an empty string: "A URL’s password is an ASCII string identifying a password. It is initially the empty string." |
Trying to parse a URL with an empty password will (incorrectly?) have
password
be set to None. However if you set password toSome("")
, then callurl.to_string()
, then the password separator in the url will be set.parse
andto_string
will fail to round trip in this edge case.The text was updated successfully, but these errors were encountered: