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

fix: wasm module loading #176

Merged
merged 4 commits into from Aug 30, 2022
Merged

fix: wasm module loading #176

merged 4 commits into from Aug 30, 2022

Conversation

Gozala
Copy link
Contributor

@Gozala Gozala commented Aug 22, 2022

@cloudflare-pages
Copy link

cloudflare-pages bot commented Aug 22, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2d14087
Status: ✅  Deploy successful!
Preview URL: https://19dd41b8.nftstorage-link.pages.dev
Branch Preview URL: https://fix-wasm-loading.nftstorage-link.pages.dev

View logs

@@ -537,7 +537,7 @@ function getTransformedResponseWithCustomHeaders(response) {

clonedResponse.headers.set(
'content-security-policy',
"default-src 'self' 'unsafe-inline' blob: data: ; form-action 'self' ; navigate-to 'self' "
"default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data: ; form-action 'self' ; navigate-to 'self' "
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have considered this in #172 (comment), but left it out. As it turns out leaving it out prevents WASM module loading which is not a desired behavior.

We could enable just wasm via unsafe-wasm-eval directive, however I don't see a good reason to disable js eval so I'm proposing this.

Copy link

@hugomrdias hugomrdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vasco-santos vasco-santos merged commit a869bc6 into main Aug 30, 2022
@vasco-santos vasco-santos deleted the fix/wasm-loading branch August 30, 2022 06:37
@ikreymer
Copy link

It should probably be: connect-src 'self' https://polygon-rpc.com https://rpc.testnet.fantom.network.
Not including self ends up blocking loading of local JS within the CID.

@vasco-santos
Copy link
Member

Thanks @ikreymer ! Yes, it won't inherit from default-src the 'self'. Adding it now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants