-
Notifications
You must be signed in to change notification settings - Fork 262
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
Not Matched Preflight Request goes through the whole Rails stack #106
Comments
Seems like it can be solved by adding match '*all', to: proc { [204, {}, ['']] }, via: :options in the beginning of |
I think Im having the same issue. Im using latest rails version on heroku. Angular, when sending post request with params, preflight options requests are causing rails to return 404 . |
Server setup:
Preflight Request:
Server Responds:
It is a syntacticly valid preflight request, which is not allowed on the server side. It gets through the whole stack, instead of being denied.
I read other issues in this repo and it seems like this is desired behaviour. Or is it a bug?
In case if this is not a bug developers have to handle invalid preflight requests when it gets through the app stack and explicitly return whatever they want. The main problem for me is that request goes through the whole stack. It is pretty obvious that server should deny invalid Preflight Requests at the first place. Maybe being able to create custom responses for invalid preflight requests sounds like a convenient and not very intrusive solutions.
I still haven't finished reading the whole W3 Org spec. But definitely will get back to it and try to find suggested way of handling invalid preflights from the server side.
I have a possible solution(optional proc or something for custom handling of invalid preflight requests) and gonna create a PR soon.
The text was updated successfully, but these errors were encountered: