-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Rack::Cors misses the OPTIONS request #93
Comments
Just curious, what does your request look like? |
Same here I keep getting a I don't know actually how to add this OPTIONS route due I don't know to which Controller to associate it. This is how my request looks like:
|
@fguillen you need specify the HTTP_ORIGIN or HTTP_X_ORIGIN in request header, it can be any value if you set allow_origin: '*' the output of your request give you the error on this line X-Rack-CORS: preflight-hit; no-origin |
You can forget my issue, it was not caused by a problem in the It was a problem in my routes actually the problem was that I hadn't configure the proper route in my Rails routes.rb, not the OPTIONS one but the normal GET for the index.. :/ , I'm a bit embarrassed :).. In my defense I'll say that the error was not clear. |
Fixed with #106. Closing |
@fguillen I wish you'd included the critical change to your routes, but we in the future appreciate that you solved your problem. https://xkcd.com/979/ |
I have rack-cors 0.4.0 installed with this config on
applicaiton.rb
and I keep getting OPTIONS requests handled by the Rails routes directly, instead of Rack::Cors:
It's as if Rack::Cors misses the request. This only happens on Production. Here's the middleware on Production environment:
Did I miss something? Any idea how to debug this? Thanks!
The text was updated successfully, but these errors were encountered: