0

I am working on an ember app ( Ember 2.11.0 ). Here is my content security policy settings:

contentSecurityPolicy: {
  'default-src': "'none'",
  'script-src': "'self'",
  'font-src': "'self'",
  'connect-src': "'self' 'localhost:4200' 'some-url'",
  'img-src': "'self'",
  'style-src': "'self' *",
  'media-src': "'self'"
}

I am getting the following error when I try to make the following XMLHttpRequest:

XMLHttpRequest cannot load url-to-sccess. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.

Any suggestions?

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
manosagent
  • 614
  • 8
  • 18
  • 1
    your server resource (the remote server you are calling) needs to allow the `localhost:4200` origin in its CORS implementation – ps2goat Mar 14 '17 at 22:50
  • See https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS and http://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource/ – sideshowbarker Mar 14 '17 at 23:02

0 Answers0