-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DELETE method becoming OPTIONS @ Heroku #197
Comments
I guess I haven't tried this one: I've moved all require 'rack/cors'
use Rack::Cors do
allow do
origins '*'
resource '*',
:headers => :any,
:expose => ['access-token', 'expiry', 'token-type', 'uid', 'client'],
:methods => [:get, :post, :options, :delete, :put]
end
end It fixed my problem on Heroku. Thanks anyway for this great gem and I apologize for any inconvenience. I hope this issue can help someone in the future. |
@lynndylanhurley strangely it only fixed it for a few days, now it's not working again (as described in my first post). And I haven't changed anything in my code. edit: WEBrick seems to receive |
Hi @scanferla - this is normal behavior for cross-domain requests. It's called a pre-flight request. Thanks for posting the solution! |
Hi,
First of all, thanks for this gem. It is working perfectly except that when I try to
delete
from AngularJS (I'm using ng-token-auth, Restangular and rails-api) my request is sent asDELETE
but Heroku console shows it asOPTIONS
.Chrome says
net::ERR_EMPTY_RESPONSE
.AngularJS and Rails are using different domains and the only thing that doesn't work is
delete
.It works 100% (including
delete
) in development mode (localhost:3000 and 0.0.0.0:5000).I've seen many resources talking about "preflight", etc, etc but nothing has worked for me so far. I don't know how to handle this
options
method and haven't found any answers on the web.Thanks in advance!
The text was updated successfully, but these errors were encountered: