5

I'm starting to work with rack-cors for a necessary cross site javascript / api implementation. Everything works fine when its working correctly, but if something in the front-end triggers a 500 error on the back-end, the client never receives the proper headers. You just see this on the client-side dev tools:

 No 'Access-Control-Allow-Origin' header is present on the requested resource.

Is this just how CORS works? Or is it some bad setup I have with rack-cors when sending this header? I tried to send the header manually during an unhandled error condition, but didn't have any luck - so I'm going on the assumption that this is just how it works, and my client side needs to be able to realize and handle that.

sideshowbarker
  • 72,859
  • 23
  • 167
  • 174
Dave Sanders
  • 2,975
  • 4
  • 32
  • 39

1 Answers1

0

You'll have to set the correct HTTP header values on the server. Here's a short article (using PHP, but adapting to Ruby should be easy) on how this can be done: CORS That Works In IE, Firefox, Chrome And Safari

Per Kristian
  • 717
  • 8
  • 10