Fix bug in multipart/form-data requests.

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.
This commit is contained in:
Josh Staiger 2010-11-22 19:31:08 -05:00
parent b0578819e1
commit 263994e8fc
1 changed files with 1 additions and 1 deletions

View 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