feat: support importmap integrity #424
Merged
+47
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for picking up integrity from the import map itself when polyfilling.
Before this feature is shipped in Chrome, this will mostly be useful for shim mode to ensure full integrity for all modules, but once it ships it allows us to ensure that the polyfill also validates integrities provided via the import map.
This implementation supports integrity in import map extensions with multiple import maps, providing an error when the integrity is overridden so that the first integrity in the import map for a given URL is always authoritative.
Explicit preload and script integrities still override the import map integrity value.
This feature is fully compatible with the existing
enforceIntegrity
option for ensuring that all modules are loaded with integrity.//cc @yoavweiss this can be considered an implementation of the feature