Kaydet (Commit) 3497155a authored tarafından Barry Warsaw's avatar Barry Warsaw

get_boundary(): Fix for SF bug #1060941. RFC 2046 says boundaries may begin

-- but not end -- with whitespace.
üst 8bd9db29
......@@ -747,7 +747,8 @@ class Message:
# RFC 2231 encoded, so decode. It better end up as ascii
charset = boundary[0] or 'us-ascii'
return unicode(boundary[2], charset).encode('us-ascii')
return _unquotevalue(boundary.strip())
# RFC 2046 says that boundaries may begin but not end in w/s
return _unquotevalue(boundary.rstrip())
def set_boundary(self, boundary):
"""Set the boundary parameter in Content-Type to 'boundary'.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment