Does Sinatra support the OPTIONS HTTP verb? Something like:
options '/' do
response.headers["Access-Control-Allow-Origin"] = "*"
response.headers["Access-Control-Allow-Methods"] = "POST"
halt 200
end
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
After a bit of hacking I managed to get it working using:
Edit:
After some more looking around on this issue, I realized that a PULL request is up on GitHub for the addition of the
OPTIONSverb (https://github.com/sinatra/sinatra/pull/129). I took the solution and hacked it in using the following snippet:Now I can simply use:
Edit:
The pull request should be merged. No more need for the hack.