Rails, REST Architecture and HTML 5: Cross domain requests with pre-flight requests

Posted by Orion on Stack Overflow See other posts from Stack Overflow or by Orion
Published on 2010-05-18T15:35:38Z Indexed on 2010/06/09 4:02 UTC
Read the original article Hit count: 379

Filed under:
|
|
|
|

While working on a project to make our site HTML 5 friendly, we were eager to embrace the new method for Cross Domain requests (no more posting through hidden iframes!!!). Using the Access Control specification we begin setting up some tests to verify the behaviour of various browsers.

The current Rails RESTful architecture relies on the four HTTP verbs: GET, POST, PUT, DELETE. However in the Access Control spec, it dictates that non-simple methods (PUT, DELETE) require a pre-flight request using the HTTP verb OPTIONS. In addition during testing we discovered that Firefox 3.5.8 pre-flight POST requests as well.

My question is this. Is anyone aware of any project for the Rails framework working to address the issue? If not, any opinions about the best strategy to support the OPTIONS method, since it has to support the routes for all the POST, PUT, DELETE methods?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about rest