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

Ensure Rack::MethodOverride #992

Open
ChanChar opened this issue Mar 15, 2024 · 3 comments
Open

Ensure Rack::MethodOverride #992

ChanChar opened this issue Mar 15, 2024 · 3 comments

Comments

@ChanChar
Copy link
Member

ChanChar commented Mar 15, 2024

Similar to #926, Rails API mode doesn't include the middleware that converts POST to PUT calls leading to Routing Errors.

Possible solutions:

  1. Create a custom controller and set the parent to that.
  2. Generator checks for all required middleware and adds them to the application.

References https://github.com/Shopify/sidekick-server/issues/728

@etiennebarrie
Copy link
Member

I don't think we can fix only our controller, middlewares are global to the application, right?

Maybe we could just change all the PUTs to be POSTs. We don't really pass in data, I don't think it even fits the semantics of HTTP.

@ChanChar
Copy link
Member Author

middlewares are global to the application

true, i was thinking if there's a way to check for existing middleware within the app, the library could fast-fail.

Maybe we could just change all the PUTs to be POSTs

That works too :)

@etiennebarrie
Copy link
Member

Would you be interested in contributing these changes?

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

No branches or pull requests

3 participants