Skip to content

esm: improve validation of resolved URLs#41446

Merged
nodejs-github-bot merged 2 commits intonodejs:masterfrom
JakobJingleheimer:fix/esm-undefined-url-bypass
Jan 19, 2022
Merged

esm: improve validation of resolved URLs#41446
nodejs-github-bot merged 2 commits intonodejs:masterfrom
JakobJingleheimer:fix/esm-undefined-url-bypass

Conversation

@JakobJingleheimer
Copy link
Member

Some ESM internals use type coercion on URL instances to get the href of the URL (ex `${url}`). This can result in 'undefined', which bypasses the current simple "is a string" validation. When that is bypassed, the resulting thrown error is a red herring, pointing to completely unrelated code.

Rather than merely switching those internals to use less errant alternatives, I think it's better to improve validation.

cc @nodejs/loaders @nodejs/modules

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

esm Issues and PRs related to the ECMAScript Modules implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants