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 all 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 @@
// 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:') {

Check failure on line 1071 in lib/internal/modules/esm/resolve.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Expected indentation of 4 spaces but found 3

Check failure on line 1071 in lib/internal/modules/esm/resolve.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

'parentProtocol' is not defined

Check failure on line 1071 in lib/internal/modules/esm/resolve.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

'parentProtocol' is not defined
throw new ERR_NETWORK_IMPORT_DISALLOWED(

Check failure on line 1072 in lib/internal/modules/esm/resolve.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Expected indentation of 6 spaces but found 5
'import of \'data:\' is not supported: import data: from a non file: is not allowed'

Check failure on line 1073 in lib/internal/modules/esm/resolve.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Expected indentation of 8 spaces but found 7

Check failure on line 1073 in lib/internal/modules/esm/resolve.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Missing trailing comma
);

Check failure on line 1074 in lib/internal/modules/esm/resolve.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Expected indentation of 6 spaces but found 2
}

Check failure on line 1075 in lib/internal/modules/esm/resolve.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Expected indentation of 4 spaces but found 0
if (protocol === 'data:' ||
(experimentalNetworkImports &&
(
Expand Down
Loading