These are chat archives for opal/opal

Apr 2017
Apr 12 2017 01:36
Hey, I'm trying to get HTTP.postcalls working, it wants to send preflight OPTIONS calls, and Sinatra isn't set up to handle them. Has anyone figured out how to get opal-jquery to not send those?
Apr 12 2017 19:28
easiest solution turned out to be doing this in Sinatra:
  options '*' do
    response['Access-Control-Allow-Origin'] = '*'
    response['Access-Control-Allow-Methods'] = 'POST'
    response['Access-Control-Allow-Headers'] = 'Content-Type'
Jamie Gaskins
Apr 12 2017 23:37
@VinceG3 Check out the rack-cors gem if you want to customize your CORS preflights.
We use it at work. Its DSL is pretty great. It works with any Rack app.