From 2be82a07b38e8c64cb066cea158e38350c07749c Mon Sep 17 00:00:00 2001 From: Bret Taylor Date: Mon, 14 Sep 2009 09:45:24 -0700 Subject: [PATCH] Fix multipart/form-data for WSGIApplication --- tornado/wsgi.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tornado/wsgi.py b/tornado/wsgi.py index 9b61e8f2a..76a032fe7 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -129,7 +129,7 @@ class HTTPRequest(object): self.arguments.setdefault(name, []).extend(values) elif content_type.startswith("multipart/form-data"): boundary = content_type[30:] - if boundary: self._parse_mime_body(boundary, data) + if boundary: self._parse_mime_body(boundary) self._start_time = time.time() self._finish_time = None @@ -288,3 +288,12 @@ class HTTPHeaders(dict): def _normalize_name(self, name): return "-".join([w.capitalize() for w in name.split("-")]) + + @classmethod + def parse(cls, headers_string): + headers = cls() + for line in headers_string.splitlines(): + if line: + name, value = line.split(": ", 1) + headers[name] = value + return headers -- 2.47.3