CORS support
kgish opened this issue · 3 comments
kgish commented
I want to add CORS support to my server by adding the following header to its response:
Access-Control-Allow-Origin: *
What's the best way to do this?
Asmod4n commented
create a finish_request callback for a resource and set the headers there: https://github.com/seancribbs/webmachine-ruby/blob/master/lib/webmachine/resource/callbacks.rb#L363
response.headers['Access-Control-Allow-Origin'] = '*'
bethesque commented
Thought we should start a wiki page for all these little "how do I do ... with webmachine?" questions. https://github.com/seancribbs/webmachine-ruby/wiki/How-do-I-do-...-with-Webmachine%3F
kgish commented
Great idea, I'll see if I can add some creative ideas there.