]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix bug in multipart/form-data requests. 176/head 177/head
authorJosh Staiger <joshstaiger@gmail.com>
Tue, 23 Nov 2010 00:31:08 +0000 (19:31 -0500)
committerJosh Staiger <joshstaiger@gmail.com>
Tue, 23 Nov 2010 00:31:08 +0000 (19:31 -0500)
In Firefox and Safari, I'm seeing k = " boundary"
for multipart/form-data posts.

" boundary" != "boundary", so the mime fields
aren't parsed.

This commit gets rid of the leading space.

tornado/httpserver.py

index c9a424a366def8cef71b5bc297bf0884c52c6df9..d11688a839283814ba637e4e6590bc48fa725b12 100644 (file)
@@ -359,7 +359,7 @@ class HTTPConnection(object):
             elif content_type.startswith("multipart/form-data"):
                 fields = content_type.split(";")
                 for field in fields:
-                    k, sep, v = field.partition("=")
+                    k, sep, v = field.strip().partition("=")
                     if k == "boundary" and v:
                         self._parse_mime_body(v, data)
                         break