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

how can I allow unsafe-eval only while I use pug #3452

Open
maa-wtag opened this issue Dec 2, 2024 · 0 comments
Open

how can I allow unsafe-eval only while I use pug #3452

maa-wtag opened this issue Dec 2, 2024 · 0 comments

Comments

@maa-wtag
Copy link

maa-wtag commented Dec 2, 2024

In one of my project written in reactjs I am using pug to render some pdf templates in my application. But it is causing issues in CSP policies as pug uses eval to generate forms from template, which is not allowed. In the console it shows me this error while I run the app.
EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
My question is if there are any way I can bypass this issue while rendering pug files in my app or is it not possible at all by default while using pug.

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