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

Change PUT methods to POST methods for better compat with API mode apps #992

Open
ChanChar opened this issue Mar 15, 2024 · 7 comments
Open
Labels
good first issue Good for newcomers

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?

Copy link

This issue has been marked as stale because it has not been commented on in two months.
Please reply in order to keep the issue open. Otherwise, it will close in 14 days.
Thank you for contributing!

@github-actions github-actions bot added the stale label Jul 13, 2024
@etiennebarrie
Copy link
Member

We should stop using PUTs and switch to POSTs.

@github-actions github-actions bot removed the stale label Jul 24, 2024
Copy link

This issue has been marked as stale because it has not been commented on in two months.
Please reply in order to keep the issue open. Otherwise, it will close in 14 days.
Thank you for contributing!

@github-actions github-actions bot added the stale label Sep 22, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2024
@adrianna-chang-shopify
Copy link
Contributor

We should still change PUTs to POSTs 😅

@adrianna-chang-shopify adrianna-chang-shopify added good first issue Good for newcomers and removed stale labels Oct 7, 2024
@adrianna-chang-shopify adrianna-chang-shopify changed the title Ensure Rack::MethodOverride Change PUT methods to POST methods for better compat with API mode apps Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants