-
Notifications
You must be signed in to change notification settings - Fork 48
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
Out of Range Port Numbers #70
Comments
Is there a specific RFC that limits the range? I would think that this range might go higher in the future, or be left open. |
@karenetheridge This limit is hardcoded into every operating system with internet support, into zillions of pieces of hardware, into the browser you are reading this message with (try |
The RFC you've posted is for TCP, not IP. From a URI point of view we don't know what protocol we're speaking though. Depending on the scheme, it might not be TCP or UDP (which both are limited to 65335). With http(s) we are probably quite sure that it's always going to be TCP, so this request is not completely unreasonable I believe. On the other hand, there could be a lot of code that for testing purposes depends on this to work, and we'd be breaking that. |
Maybe it makes sense to limit the scope of the ticket to the http(s) scheme. The relevant specification is then RFC2616 which specifies in section 1.4:
So theoretically, it would be possible to define URLs with the http scheme that have other semantics for the port, as long as it is a sequence of decimal digits, and the port can default to 80. But then there is a gap between that academic point of view and the use of URLs as a living standard as implemented by all browsers. And that gap limits the usefulness of the I agree that from a strict - acually relaxed ;) - standard's point of view, every sequence of decimal digits must be accepted for the port. But what about introducing a feature switch that activates the conventions and restrictions that real-world http software use? Or build that into the Maybe this discussion would fit better into the context of #68 and #69. According to the standard, http://127.0.0.1:8080/ and http://0x7f.1:0008080/ are probably very different URIs/URLs. But every browser I have at hand treats them as identical locators, and it can be a subtle source of bugs or even security problems if that is not taken into account. |
In
URI 1.76
you can pass port numbers greater than 65535 without error:$ perl -MURI -e "CORE::say URI->new('https://xyz:65536')->canonical->port" 65536
The text was updated successfully, but these errors were encountered: