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

[Error] Violation of following Content Security Policy directive #54

Open
laurentsmohr opened this issue Dec 8, 2021 · 3 comments
Open

Comments

@laurentsmohr
Copy link

Getting this error when trying to make a request from the frontend:

xhr.js:177 Refused to connect to 'http://127.0.0.1:3000/api/users' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.

@laurentsmohr laurentsmohr changed the title [ErrorViolation of following Content Security Policy directive [Error] Violation of following Content Security Policy directive Dec 8, 2021
@thiennv-sotanext
Copy link

Add meta tag in public/index.html file are working <meta http-equiv="Content-Security-Policy" content="connect-src 'self' localhost:3000; />`

@kmvsingh007
Copy link

@thiennv-sotanext Giving same error after adding the meta tag in public/index.html

xhr.js:177 Refused to connect to 'http://127.0.0.1:3000/api/users' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.

Kindly provide any other solution. Thanks in advance.
error

@dream-topdev
Copy link
Contributor

#56
you can remove unused helmet module

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

4 participants