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

Embed API - CSP issue with promise #50

Open
bloquecapitals opened this issue Feb 3, 2023 · 0 comments
Open

Embed API - CSP issue with promise #50

bloquecapitals opened this issue Feb 3, 2023 · 0 comments

Comments

@bloquecapitals
Copy link

I have been using the API and providing a URL and not having any problems but when I switch to using the promise I am getting an error back in the console and the file doesn't load. It looks as if the error is in the viewer.js

I get the error:

"Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' use.typekit.net assets.adobedtm.com www.adobe.com/marketingtech/ prod.adobeccstatic.com/utilnav/ widget.uservoice.com by2.uservoice.com/t2/ assets.adobe.com api.demandbase.com/api/v2/ip.json commerce.adobe.com". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present."

Is there something I need to add to my CSP Header to prevent this?

To reproduce the error here's what I am doing using I am using https://documentservices.adobe.com/view-sdk/viewer.js

var adobeDCView = new AdobeDC.View({
clientId: {clientId},
divId: "adobe-dc-view",
});

adobeDCView.previewFile({
content: {
promise: readFile(buffer),
},
metaData: {
fileName: "FileName"
}
}, {});
}

Any help would be greatly appreciated.

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

No branches or pull requests

1 participant