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:
11
spec/routing/options_requests_spec.rb
Normal file
11
spec/routing/options_requests_spec.rb
Normal 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
|
Reference in New Issue
Block a user