From: Ben Darnell Date: Wed, 4 Aug 2010 19:02:05 +0000 (-0700) Subject: Parse form bodies on PUT as well as POST. X-Git-Tag: v1.1.0~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2aa8927314d8bfd2e190d04bdd7642b85983411f;p=thirdparty%2Ftornado.git Parse form bodies on PUT as well as POST. HTML5 adds support for PUT and DELETE in forms, so x-www-form-urlencoded PUT bodies are now possible. --- diff --git a/tornado/httpserver.py b/tornado/httpserver.py index 6cece5d7a..8b6368f0b 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -312,7 +312,7 @@ class HTTPConnection(object): def _on_request_body(self, data): self._request.body = data content_type = self._request.headers.get("Content-Type", "") - if self._request.method == "POST": + if self._request.method in ("POST", "PUT"): if content_type.startswith("application/x-www-form-urlencoded"): arguments = cgi.parse_qs(self._request.body) for name, values in arguments.iteritems():