From: Ben Darnell Date: Sun, 25 May 2014 15:39:12 +0000 (-0400) Subject: Remove HTTP method check from HTTPServerRequest._parse_body. X-Git-Tag: v4.0.0b1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa29f20de36b65b3d8a4c2d0c2dea5bf58074de8;p=thirdparty%2Ftornado.git Remove HTTP method check from HTTPServerRequest._parse_body. The semantics of a body are not well-defined for some methods, but if a client sends a body with the correct content-type, we might as well parse it no matter what the method. Closes #1011. --- diff --git a/tornado/httputil.py b/tornado/httputil.py index 077fdc2f9..6e110d903 100644 --- a/tornado/httputil.py +++ b/tornado/httputil.py @@ -430,14 +430,13 @@ class HTTPServerRequest(object): return None def _parse_body(self): - if self.method in ("POST", "PATCH", "PUT"): - parse_body_arguments( - self.headers.get("Content-Type", ""), self.body, - self.body_arguments, self.files, - self.headers) - - for k, v in self.body_arguments.items(): - self.arguments.setdefault(k, []).extend(v) + parse_body_arguments( + self.headers.get("Content-Type", ""), self.body, + self.body_arguments, self.files, + self.headers) + + for k, v in self.body_arguments.items(): + self.arguments.setdefault(k, []).extend(v) def __repr__(self): attrs = ("protocol", "host", "method", "uri", "version", "remote_ip")