Uh oh!
There was an error while loading. Please reload this page.
url: fix url.parse() for @hostname - #42136
Conversation
nodejs-github-bot
commented
Feb 26, 2022
Instead of fixing the legacy api, shouldn't we help users migrate to the WHATWG url api which we recommend in the docs? |
lpinca
commented
Feb 26, 2022
No objections but I think special casing It should ignore all forward and backward slashes for special protocols. |
Trott
commented
Feb 26, 2022
I think we should do both if:
|
Oh, yes, very much so. Let me throw this into draft mode and see if I can address all those other kinds of edge cases without breaking existing tests/usage. |
RaisinTen
commented
Feb 26, 2022
According to Lines 1562 to 1565 in aa97c9d it is a known source of bugs and fixing those would motivate users to keep using them and that defeats the purpose of labelling it as a legacy API, right? Why would people move to the WHATWG URL API if we accept fixes for the legacy API? |
Trott
commented
Feb 26, 2022
A lot of people are using We should not refuse fixes for an insecure API as a way of making users move to a newer API. (I'm not saying we have to do the fixes ourselves. But refusing to land a provided fix seems hostile.) If we want to provide stronger encouragement for people to move off of |
Trott
commented
Feb 26, 2022
That will be a breaking change, so I'm going to open that as a follow-on PR and leave this one as-is. |
Trott
commented
Feb 26, 2022
Follow on PR with breaking changes: #42140 |
Does that mean that |
RaisinTen
commented
Feb 27, 2022
According to #42136 (comment), one of the scenarios when we should go ahead with the fix is when:
but that fix is a breaking change. Isn't that contradictory? |
Trott
commented
Feb 27, 2022
Potential security problems in |
To be clear for anyone following along, we're talking about a different PR at this point. This question is about #42140. That PR is a breaking change, but this one is not. That set of conditions was a sufficient set of conditions, not a necessary set of conditions. In other words, we can choose to break legacy APIs in major releases. There is a lot to weigh there: Disruption to users and the ecosystem vs. moving |
RaisinTen
commented
Feb 28, 2022
cc @nodejs/url |
RaisinTen
left a comment
There was a problem hiding this comment.
Seems reasonable to me, approving!
Trott
commented
Mar 2, 2022
@nodejs/url Anyone want to be the second approval for this? |
Trott
commented
Mar 2, 2022
Please don't add the |
Make url.parse() behave more like browsers and WHATWHG URL when dealing with URLs that of the format `http:@example.com`. This is the same as `http://example.com`. This issue was reported by P0cas. https://github.com/P0cas PR-URL: nodejs#42136 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Trott
commented
Mar 2, 2022
Landed in 010cb71 |
Make url.parse() behave more like browsers and WHATWHG URL when dealing with URLs that of the format `http:@example.com`. This is the same as `http://example.com`. This issue was reported by P0cas. https://github.com/P0cas PR-URL: nodejs#42136 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
arcanis
commented
Mar 10, 2022
This diff seems to break Yarn classic which does Node 17.6: |
aduh95
commented
Mar 10, 2022
Should we revert? |
I've landed a fix in Yarn ( |
PR to revert: #42280 @arcanis FYI adding Yarn (both classic and Berry) to https://github.com/nodejs/citgm could help catch this kind of regressions before we release new versions of Node.js, I think it's worth considering. (and if Yarn is already on the CITGM list, we'd need to investigate why the failure wasn't caught up on the release run https://ci.nodejs.org/job/citgm-smoker/2869/) |
Hi, and the preference in my org is to use LTS versions. |
aduh95
commented
Apr 6, 2022
There’s no intention of backporting this to LTS releases, it’s a breaking change that has been reverted, and that we are not interested in landing anymore. Snyk report is wrong when it says Node.js 17.7.1 is not affected (it is, we have reverted the fix on that version), and is wrong when it calls it a vulnerability. FYI that Snyk report is only about the legacy URL parser, if you are using the WHATWG one, you can safely ignore that quirk. |
mcollina
commented
Apr 6, 2022
I would also note that this is not a vulnerability. We have analyzed this in great detail and it's not a problem. |
Make url.parse() behave more like browsers and WHATWHG URL when dealing with URLs that of the format `http:@example.com`. This is the same as `http://example.com`. This issue was reported by P0cas. https://github.com/P0cas PR-URL: nodejs#42136 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Make url.parse() behave more like browsers and WHATWHG URL when dealing
with URLs that have the format
http:@example.com. This is the same ashttp://example.com.