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

.ngf-hide style in javascript results in CSP warning #1122

Closed
timhoekstra opened this issue Nov 6, 2015 · 5 comments
Closed

.ngf-hide style in javascript results in CSP warning #1122

timhoekstra opened this issue Nov 6, 2015 · 5 comments

Comments

@timhoekstra
Copy link

A Content-Security-Policy header containing ' script-src 'self'; style-src 'self'; ' will result in the following warning:

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'".

Stacktrace:
(anonymous function) @ ng-file-upload.js:883
(anonymous function) @ ng-file-upload.js:1016

@danialfarid
Copy link
Owner

What browser what version? Does it happen on the demo page as well?

@timhoekstra
Copy link
Author

Tested in the latest version of chrome. The demo page doesn't give a warning because it hasn't got a content security policy enabled. I have it enabled from my backend to prevent things like XSS attacks.

@danialfarid
Copy link
Owner

Angular adds styles to the head too, do you get the same warning for angular?

@timhoekstra
Copy link
Author

In angular that part is solved by adding an ngCsp directive. That tells angular to stop injecting css styles. See https://docs.angularjs.org/api/ng/directive/ngCsp

danialfarid pushed a commit that referenced this issue Nov 10, 2015
@danialfarid
Copy link
Owner

Fixed at 10.0.0.

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

2 participants