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

isNode check causes unsafe-eval error when using strict CSP policies #23

Open
lfittl opened this issue Dec 20, 2016 · 0 comments
Open

Comments

@lfittl
Copy link

lfittl commented Dec 20, 2016

Ever since c14972e the following will happen in the browser (e.g. Chrome 55) when one has a content security policy that forbids eval:

Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an
allowed source of script in the following Content Security Policy directive

This is caused by the following line in https://github.com/kadirahq/lokka-transport-http/blob/master/lib/index.js#L7:

const isNode = new Function('try {return this===global;}catch(e){return false;}');

Unfortunately I'm not able to enable eval just for lokka, and this currently forces me to remain at 1.4.0, the last version that didn't have this check.

Any chance this check could be replaced with something else?

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