Just check the filename existing.

This commit is contained in:
Joshua Harlow
2013-07-20 16:40:11 -07:00
parent 4b1ea7048a
commit 0a7285e84e

View File

@@ -76,8 +76,6 @@ def _replace_header(msg, key, value):
def _set_filename(msg, filename):
if not filename:
return
del msg['Content-Disposition']
msg.add_header('Content-Disposition',
'attachment', filename=str(filename))
@@ -141,7 +139,8 @@ class UserDataProcessor(object):
# Copy various headers from the old part to the new one,
# but don't include all the headers since some are not useful
# after decoding and decompression.
_set_filename(n_part, part.get_filename())
if part.get_filename():
_set_filename(n_part, part.get_filename())
for h in ('Launch-Index',):
if h in part:
_replace_header(n_part, h, str(part[h]))