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
  • 81,827
  • 26
  • 193
  • 197
Dave Sanders
  • 3,135
  • 4
  • 33
  • 43

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
  • 785
  • 8
  • 10