-
Notifications
You must be signed in to change notification settings - Fork 329
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
Fails to parse port 80 only #28
Comments
The idea is to do like browsers’s There’s a I’ve considered changing "port" to be the current "port or default", and have a "port is default" boolean or something. What do you think? |
I would defer to the 'Principle of least astonishment' and say that a URL library in isolation should parse all ports equally. Behaviour like If anything, I would say maybe there should be a method |
I’m very skeptical of this so-called "principle of least astonishment". What’s astonishing to someone might be obvious and make perfect sense to someone else. Everyone has different experience and makes different assumptions. Regardless, a more important concern for this library is interoperability. Any deviation like this is a potential number of sites that work fine in other browsers but are broken in Servo. |
6 years later and just reporting that I'm finding myself quite astonished here. Program:
Output:
I think is very unintuitive, I clearly set the port and expect it to be there. Erasing it for 80 is magic. |
For people coming along later and looking for a better option, use |
When port 80 is in the passed in
&str
the resultingUrl
object shows a port value ofNone
.The text was updated successfully, but these errors were encountered: