Skip to content
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

Responding to all verbs in a namespace causes Options to start failing #2175

Closed
myxoh opened this issue Apr 30, 2021 · 3 comments · Fixed by #2176
Closed

Responding to all verbs in a namespace causes Options to start failing #2175

myxoh opened this issue Apr 30, 2021 · 3 comments · Fixed by #2176
Assignees

Comments

@myxoh
Copy link
Member

myxoh commented Apr 30, 2021

If a namespace responds to: POST, PUT, PATCH, GET, DELETE on a base resource - the Options preflight gives back a 404. If you remove any of the verbs it works as expected.

Spec reproducing the behaviour:
#2176

I'll investigate what's going on and attempt to fix

@myxoh myxoh self-assigned this Apr 30, 2021
@myxoh
Copy link
Member Author

myxoh commented Apr 30, 2021

OK after some investigation - I've found the root cause being this line:
return if not_allowed_methods.empty?
(Now on: lib/grape/api/instance.rb after my changes but originally introduced:)
https://github.com/ruby-grape/grape/commit/e54b8b0e40d34b64df65c2002f0dcc8be7edfcf3

@myxoh
Copy link
Member Author

myxoh commented Apr 30, 2021

Coming from this PR: #1263

@myxoh
Copy link
Member Author

myxoh commented Apr 30, 2021

OK managed to find a way of squaring the problem originally being solved on that PR and my problem.. Adding the fix soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant