mirror of
https://lab.it.hs-hannover.de/misc/pymilter-suspicious-from.git
synced 2024-11-27 21:40:45 +01:00
Fix another decoding issue, too
This commit is contained in:
parent
907f0fe7b7
commit
0aa8dbb89c
2
main.py
2
main.py
@ -32,7 +32,7 @@ def get_decoded_header(value):
|
|||||||
decoded_header_items = decode_header(value)
|
decoded_header_items = decode_header(value)
|
||||||
decoded_header_value = ''
|
decoded_header_value = ''
|
||||||
for item in decoded_header_items:
|
for item in decoded_header_items:
|
||||||
decoded_item = item[0].decode(item[1]) if item[1] is not None else item[0]
|
decoded_item = item[0].decode(item[1], 'replace') if item[1] is not None else item[0]
|
||||||
if isinstance(decoded_item, bytes):
|
if isinstance(decoded_item, bytes):
|
||||||
decoded_item = decoded_item.decode('ascii', 'replace')
|
decoded_item = decoded_item.decode('ascii', 'replace')
|
||||||
decoded_header_value += decoded_item
|
decoded_header_value += decoded_item
|
||||||
|
Loading…
Reference in New Issue
Block a user