Implement Cross-Origin Resource Sharing:

* Add Api::ApplicationController
* Route OPTION requests (CORS preflight) to API application controller
* Filter all API requests through #cor_filter in API application
  controller
This commit is contained in:
Thibault Jouan
2012-02-26 14:10:19 +00:00
parent 88d3242843
commit 6379da88e2
6 changed files with 118 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
require 'spec_helper'
describe '/api OPTIONS requests routing' do
it 'routes to Api::ApplicationController#cor_preflight' do
{ :options => '/api/v0' }.should route_to(
:controller => 'api/application',
:action => 'cor_preflight',
:all => 'v0'
)
end
end