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

CSP report sent to undefined #5166

Closed
MadMub opened this issue Nov 27, 2015 · 4 comments
Closed

CSP report sent to undefined #5166

MadMub opened this issue Nov 27, 2015 · 4 comments

Comments

@MadMub
Copy link

MadMub commented Nov 27, 2015

Not sure if this is the right spot to post (might be better suited for ember-cli-csp-report addon) or if its even a bug. I am new to ember, and using the ember cli to start a fresh project, running ember server and opening localhost:4200 in FF seems to be constantly loading (the spinner never stops, despite content being rendered, this could be normal behaviour) but I did notice in the dev tools a bunch of CSP reports are fired off to undefined:4200 (to me that doesn't seem right, and as expected they never get a response).

Screenshot:
screenshot 2015-11-26 23 55 11

UPDATE:
Performance seems to be much better in chromium, where the csp reports don't appear to be blocking the site, on Firefox for some reason my interactions are unresponsive for quite some time (minutes). From what I've read csp reports appear to be more of a dev tool to keep these issues on the mind of the developer, so I doubt much will come of this issue.

I will leave it open in case having reports sent to undefined is in fact a bug (again though this could be something that needs to be addressed on the addon? Not sure if ember-cli has some broken configuration I'm unaware of).

@RodrigoBalest
Copy link

I'm having the same 'undefined' issue.

@stefanpenner
Copy link
Contributor

Performance seems to be much better in chromium, where the csp reports don't appear to be blocking the site, on Firefox for some reason my interactions are unresponsive for quite some time (minutes).

This seems like a firefox bug, be sure to open an issue on their tracker.

For developers affected by this, consider removing the CSP add-on. (We may disable it by default anyways soon, as the ergonomics are poor).

@RodrigoBalest
Copy link

I managed to solve this by adding the line

    "host": "localhost"

to .ember-cli file.

Also, to avoid csp detecting inline scripts (as the one at the index page) as bad code, I added the following code to the file config/environment.js

ENV.contentSecurityPolicy = {
  'script-src' : "'unsafe-inline' 'self'"
};

right before the line

if (environment === 'development') {

@bevinhex
Copy link

adding "host": "localhost" worked for me

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