Don't restrict parsing the request body to PUT and POST requests #23

Merged
merged 1 commit into from Feb 21, 2012

Conversation

Projects
None yet
3 participants
Contributor

monken commented Dec 29, 2011

I use Twiggy as a proxy in front of ElasticSearch. ES allows both GET and DELETE requests with a request body. I don't see a reason why Twiggy shouldn't support this as well.

Contributor

monken commented Dec 29, 2011

Not sure what you are saying, but from the link I'd say you are in favor of this patch :-)

Well, I mostly wanted to bring the facts in. The one thing that truly surprised me was "the presence of a message-body is signaled by the inclusion of a Content-Length or Transfer-Encoding header (section 4.3)".

I figured that a message-body could appear in any message, with an assumed text/plain type. But perhaps HTTP 1.1's pipeline design required more explicit indications.

So yes: If those headers are present then there is a message body, and if there is a body then it should be parsed. If those headers are not present, though, I wouldn't bother.

miyagawa added a commit that referenced this pull request Feb 21, 2012

Merge pull request #23 from monken/master
Don't restrict parsing the request body to PUT and POST requests

@miyagawa miyagawa merged commit c992337 into miyagawa:master Feb 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment