Skip to content

Commit

Permalink
Merge pull request #36 from derekmwright/master
Browse files Browse the repository at this point in the history
Fixes #35 - Preserve content headers on enveloped data
  • Loading branch information
abhishek-ram authored Sep 6, 2021
2 parents ead0a64 + 69c551b commit c8cc68f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyas2lib/as2.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,12 @@ def parse(self, raw_content, find_org_cb, find_partner_cb, find_message_cb=None)

# Update the payload headers with the original headers
for k, v in as2_headers.items():
if self.payload.get(k) and k.lower() != "content-disposition":
preserve = [
"content-type",
"content-disposition",
"content-transfer-encoding",
]
if self.payload.get(k) and k.lower() not in preserve:
del self.payload[k]
self.payload.add_header(k, v)

Expand Down

0 comments on commit c8cc68f

Please sign in to comment.