When a parts content type is found to be different than

its original content type said it is, make sure we set
the new value, also unsure if the old top level message
should have the same header (which will flip-flop).
This commit is contained in:
Joshua Harlow 2012-08-31 18:12:30 -07:00
parent 1685fc83c0
commit c307c3507a
1 changed files with 8 additions and 0 deletions

View File

@ -84,6 +84,12 @@ class UserDataProcessor(object):
if ctype is None:
ctype = ctype_orig
if ctype != ctype_orig:
if CONTENT_TYPE in part:
part.replace_header(CONTENT_TYPE, ctype)
else:
part[CONTENT_TYPE] = ctype
if ctype in INCLUDE_TYPES:
self._do_include(payload, append_msg)
continue
@ -92,6 +98,8 @@ class UserDataProcessor(object):
self._explode_archive(payload, append_msg)
continue
# Should this be happening, shouldn't
# the part header be modified and not the base?
if CONTENT_TYPE in base_msg:
base_msg.replace_header(CONTENT_TYPE, ctype)
else: