Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'norman-labs/branch2.4'

Conflicts:
	tornado/httputil.py
  • Loading branch information...
commit ae166d72192d001be8c2b349a287a3027fb88db1 2 parents 330d8ec + c791984
@bdarnell bdarnell authored
Showing with 9 additions and 0 deletions.
  1. +2 −0  tornado/httputil.py
  2. +7 −0 tornado/test/httpserver_test.py
View
2  tornado/httputil.py
@@ -236,6 +236,8 @@ def parse_body_arguments(content_type, body, arguments, files):
uri_arguments = parse_qs_bytes(native_str(body))
for name, values in uri_arguments.items():
values = [v for v in values if v]
+ uri_arguments = parse_qs_bytes(native_str(body), keep_blank_values=True)
+ for name, values in uri_arguments.items():
if values:
arguments.setdefault(name, []).extend(values)
elif content_type.startswith("multipart/form-data"):
View
7 tornado/test/httpserver_test.py
@@ -258,6 +258,8 @@ class EchoHandler(RequestHandler):
def get(self):
self.write(recursive_unicode(self.request.arguments))
+ def post(self):
+ self.write(recursive_unicode(self.request.arguments))
class TypeCheckHandler(RequestHandler):
def prepare(self):
@@ -316,6 +318,11 @@ def test_empty_query_string(self):
data = json_decode(response.body)
self.assertEqual(data, {u("foo"): [u(""), u("")]})
+ def test_empty_post_parameters(self):
+ response = self.fetch("/echo", method="POST", body="foo=&bar=")
+ data = json_decode(response.body)
+ self.assertEqual(data, {u("foo"): [u("")], u("bar"): [u("")]})
+
def test_types(self):
headers = {"Cookie": "foo=bar"}
response = self.fetch("/typecheck?foo=bar", headers=headers)
Please sign in to comment.
Something went wrong with that request. Please try again.