-
Notifications
You must be signed in to change notification settings - Fork 141
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
Don't coerce numbers to strings for port checking #377
Comments
So this would mean changing the type from If we want to ignore out-of-band values something like Either way, prose will need to be adjusted as well to deal with the fact that it can now receive a number. |
I am expressing implementer interest for Node.js (not sure if that counts, works that way, or if I get to do that - but I noticed the flag and we are a platform after all). |
Why include USVString in the type? I guess for the return value :-/. Unfortunate IDL limitation... Alternately you could modify the parser to fail to parse such ports instead of gobbling up as much as it can? |
I think we also want to keep We could also modify the parser or perhaps the setter to terminate early if the value contains a "." or "e" or some such. Maybe that's easier. |
I think modifying the parser will be easier, but we have to make sure not to change how the parser works for non-state-overridden usage (i.e., full URL parses). |
What would it take to move forward on this? |
A concrete proposal for what exactly the change ends up looking like (perhaps even in the form of a PR) would be good. Then we'll have to convince at least one browser to implement it to see if it's actually feasible, update and add tests, and then get everyone else along too. |
See also https://whatwg.org/working-mode#changes. |
Some very general questions:
We've been integrating web APIs (like URL) and are looking into integrating more WHATWG APIs where it makes sense to improve browser <-> node compatibility. |
Node qualifies as an implementer, but I think in order to make changes on the web we'll continue to need two browsers. I think TC39 is roughly equivalent in that regard. If Node wanted to change something I'd expect that to be taken seriously though, if that's what you mean. In terms of standards development WHATWG talks about participants: https://whatwg.org/workstream-policy. Node does not appear to be listed in https://github.com/whatwg/participant-data/blob/master/entities.json so they have not signed up at https://participate.whatwg.org/agreement (yet). The Steering Group does have members, but they don't participate in making standards and mostly serve as an escalation path. As per https://whatwg.org/sg-agreement that's currently a closed group. Hope that helps, if you want to discuss this further I suggest raising an issue at https://github.com/whatwg/meta/issues as it's a little off-topic here. |
Thanks a lot! I'll take this up internally in Node first and if I have any more questions I'll open a meta issue. |
Closing this as there hasn't been movement here for quite a while suggesting the need has gone away. If this remains a common need I'm happy to reconsider though. |
Following discussion from nodejs/node#19595 cc @annevk @nodeav
At the moment
URL
s convert ports passed as numbers to strings in order to get the port number (specified in https://url.spec.whatwg.org/#port-state ). This is like theparseInt
algorithm in that it ignores things after the first dot - which enables the following behavior:This is a feature request to validate and ignore passed numbers to the port setter.
The text was updated successfully, but these errors were encountered: