Skip to content
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

Allow nested data: imports with --experimental-network-imports #53998

Closed
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions lib/internal/modules/esm/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -1068,15 +1068,11 @@ function defaultResolve(specifier, context = {}) {
// Avoid accessing the `protocol` property due to the lazy getters.
protocol = parsed.protocol;

if (protocol === 'data:' &&
parsedParentURL.protocol !== 'file:' &&
experimentalNetworkImports) {
throw new ERR_NETWORK_IMPORT_DISALLOWED(
specifier,
parsedParentURL,
'import data: from a non file: is not allowed',
);
}
if (protocol === 'data:' && parentProtocol !== 'file:' && parentProtocol !== 'data:') {
throw new ERR_NETWORK_IMPORT_DISALLOWED(
'import of \'data:\' is not supported: import data: from a non file: is not allowed'
);
rutaganda-salim marked this conversation as resolved.
Show resolved Hide resolved
}
if (protocol === 'data:' ||
(experimentalNetworkImports &&
(
Expand Down
Loading