2014-02-10 02:11:52 -05:00
|
|
|
if GlobalSetting.enable_cors
|
2013-04-22 05:16:58 -04:00
|
|
|
require 'rack/cors'
|
|
|
|
|
|
|
|
Rails.configuration.middleware.use Rack::Cors do
|
|
|
|
allow do
|
2014-02-10 02:11:52 -05:00
|
|
|
origins GlobalSetting.cors_origin
|
|
|
|
resource '*', headers: :any, methods: [:get, :post, :options]
|
2013-04-22 05:16:58 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|