-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
lib: fix regular expression to detect /
and \
#40325
Conversation
@nodejs/modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks, and apologies for the slip!
Since |
@bmeck this code path does apply to data URLs, in that data URLs that contain a percent encoded comma will no longer throw, even if that percent encoding is in the body of the data URL. On the other hand, percent encoded |
@guybedford my main concern is how: import(`data:text/javascript;x="${encodeURIComponent(',')}",export default 123`); is interpreted and ensuring it works, otherwise we could just leave the |
@bmeck I believe right now your example would fail across all versions, where this PR fixes that. |
Ah, I see |
@bmeck since data URLs definitely never hit this path at all, I don't think there's any test coverage to apply here, are you ok with landing as is to get this fix in? I am working on a PR to clarify the data URL distinction in the spec as well as some other encoding cases. |
@guybedford yea that is fine, though also note that Blob is up and coming |
PR-URL: nodejs#40325 Fixes: nodejs#40305 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
PR-URL: nodejs#40325 Fixes: nodejs#40305 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
PR-URL: #40325 Backport-PR-URL: #40564 Fixes: #40305 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
PR-URL: #40325 Backport-PR-URL: #40564 Fixes: #40305 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
Notable changes: - **deps**: upgrade npm to 8.1.2 (npm team) [#40643](#40643) - **deps**: update c-ares to 1.18.1 (Richard Lau) [#40660](#40660) - **doc**: add VoltrexMaster to collaborators (voltrexmaster) [#40566](#40566) - **lib**: fix regular expression to detect \`/\` and \`\\\` (Francesco Trotta) [#40325](#40325) PR-URL: #40974
Notable changes: - **deps**: upgrade npm to 8.1.2 (npm team) [#40643](#40643) - **deps**: update c-ares to 1.18.1 (Richard Lau) [#40660](#40660) - **doc**: add VoltrexMaster to collaborators (voltrexmaster) [#40566](#40566) - **lib**: fix regular expression to detect \`/\` and \`\\\` (Francesco Trotta) [#40325](#40325) PR-URL: #40974
Notable changes: - **deps**: upgrade npm to 8.1.2 (npm team) [#40643](#40643) - **deps**: update c-ares to 1.18.1 (Richard Lau) [#40660](#40660) - **doc**: add VoltrexMaster to collaborators (voltrexmaster) [#40566](#40566) - **lib**: fix regular expression to detect \`/\` and \`\\\` (Francesco Trotta) [#40325](#40325) PR-URL: #40974
PR-URL: #40325 Backport-PR-URL: #40565 Fixes: #40305 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
Notable changes: - **deps**: upgrade npm to 8.1.2 (npm team) [nodejs#40643](nodejs#40643) - **deps**: update c-ares to 1.18.1 (Richard Lau) [nodejs#40660](nodejs#40660) - **doc**: add VoltrexMaster to collaborators (voltrexmaster) [nodejs#40566](nodejs#40566) - **lib**: fix regular expression to detect \`/\` and \`\\\` (Francesco Trotta) [nodejs#40325](nodejs#40325) PR-URL: nodejs#40974
PR-URL: nodejs/node#40325 Fixes: nodejs/node#40305 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
Allow importing from file URLs with encoded commas. Forbid encoded backslashes. Fixes #40305.