-
Notifications
You must be signed in to change notification settings - Fork 251
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
Do not set Content-Type for DELETE requests #132
Conversation
DELETE requests, like GET requests, should not have a Content-Type header as there will not be a request body. However, rack-test attempts to set a Content-Type of application/x-www-form-urlencoded which messes with some web frameworks' test suites (including my own). Instead of trying to set a Content-Type header and request body on DELETEs, treat them more like GET requests. Signed-off-by: David Celis <me@davidcel.is>
a319239
to
c1849d6
Compare
Hey @brynary, just a friendly bump on this. It would be nice to get this fixed merged upstream. Thanks! |
Thanks to davidcelis. Implements: [PR 132](#132)
@davidcelis thank you for your PR. finally it was merged as d016695 . |
@junaruga Thanks for letting me know! I hope this doesn't come off the wrong way, but I feel like I have to ask: why was my PR committed by two other people instead of just being merged into the project? It's not that I care too much about my profile stats, but it feels weird and a little unsavory to see my exact commit authored by people who weren't me. It makes me feel not recognized for my work/contribution, and it also makes me feel much less likely to contribute in the future. |
@davidcelis I apologize to you about it. The reason is because this However recently the situation was changed. 2 leaders were appeared in this project. They were the light of this project. They recovered this dead project. Last time only 1 maintainer for We have to admit that we missed merging many PRs to master this week. I definitely write every people's name like you to I really thank you all very much. |
@junaruga Thank you very much for your explanation, I really appreciate it ❤️. And thank you for picking up the maintainership of this project! |
@davidcelis @scepticulous this pull request (well, the actual commit, in practice) breaks some of my projets when upgrading rack-test from 0.6.3 to 0.7.0. When a body is provided (which is not recommended, but actually allowed by the HTTP spec), it's not a good idea to strip the content type completely. Any idea about how we could find a solution that works for everyone? |
rack-test 0.7.0 introduces controversial changes, in particular about body provided on DELETE requests: rack/rack-test#132 Waiting for a solution there, we force the version of rack-test to a version that is known for working on Enspirit projets.
@blambeau Correct me if I'm wrong, but there's nothing stopping you from manually setting a |
@davidcelis I have similar troubles to @blambeau. I cannot set JSON payload to DELETE requests. I'm wondering why it was implemented that way? WHy we could not just skip content type setting if the method is |
DELETE requests, like GET requests, should not have a Content-Type
header as there will not be a request body. However, rack-test attempts
to set a Content-Type of application/x-www-form-urlencoded which messes
with some web frameworks' test suites (including my own). Instead of
trying to set a Content-Type header and request body on DELETEs, treat
them more like GET requests.
Signed-off-by: David Celis me@davidcel.is