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

Remove request body from HEAD and DELETE by default #346

Merged

Conversation

manuel-watchenterprise
Copy link
Contributor

For specific HTTP methods. For example, DELETE is not officially supported to have request body, however, only GET methods are prevented to have empty request bodies in the output.

@manuel-watchenterprise
Copy link
Contributor Author

@romalytvynenko Actually, I would rather make the default restrict to be ['get', 'head', 'delete'] and so anyone will be able to overwrite this with e.g. ['get'] if they will. But, current implementation is the way around to be completely backward compatible.

@romalytvynenko romalytvynenko changed the title Feat: restrict request body Remove request body by default from HEAD and DELETE Mar 23, 2024
@romalytvynenko romalytvynenko changed the title Remove request body by default from HEAD and DELETE Remove request body from HEAD and DELETE by default Mar 23, 2024
@romalytvynenko
Copy link
Member

Hey @manuel-watchenterprise

Thanks for the PR. For now I decided to keep it as simple as possible while technically changing Scramble behavior – delete and head will not have request bodies. Testing with real API shows that Laravel simply won't "see" params for these methods if sent in request body.

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 this pull request may close these issues.

2 participants