-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🐛 [amp-script] skip sha384 check for cross-origin scripts in sandboxed mode #36618
Conversation
'alert(1)' | ||
) | ||
|
||
service.checkSha384.withArgs('alert(1)').resolves() |
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.
This function should never be called, so we don't need to stub it
service.checkSha384.withArgs('alert(1)').resolves() |
element.setAttribute('src', 'https://bar.example/bar.js') | ||
element.setAttribute('sandboxed', '') | ||
|
||
script.buildCallback() |
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.
buildCallback returns a promise, so you'll need to await it
script.buildCallback() | |
await script.buildCallback() |
4799504
to
98ea7cc
Compare
Congratulations @zshnr on your first AMP PR 🎉 |
Thanks for all your help @samouri !! 😄 |
…d mode (ampproject#36618) * skips sha384 check for remote scripts in sandboxed mode * update unit tests for amp-script * lint fix
Summary
Skips the CSP hash check for a cross-origin source passed to
amp-script
since this is one of the features ofsandboxed
mode introduced in PR #33643.Fixes #36614