Skip to content

Cross domain requests, Access Control Allow Origin

Igor Bochkariov edited this page Sep 22, 2013 · 1 revision

To be able to receive XMLHttpRequest requests rack should be properly configured. In Padrino this could be done with https://github.com/cyu/rack-cors and adding to your app.rb:

use Rack::Cors do
  allow do
    # put real origins here
    origins '*'
    # and configure real resources here
    resource '*', :headers => :any, :methods => [:get, :post, :options]
  end
end

More info on this: https://github.com/padrino/padrino-framework/issues/1267

Thanks to @henry74 for bringing this to attention.

Clone this wiki locally