summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdmarcpipe.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/dmarcpipe.py b/dmarcpipe.py
index bbcc914..0178a1e 100755
--- a/dmarcpipe.py
+++ b/dmarcpipe.py
@@ -47,7 +47,12 @@ def zip2xml(data):
return z.open(n[0]).read()
gzip2xml = lambda data: gz_decompress(data)
-octet_stream = lambda data: decode(data, magic(data).mime_type)
+
+def octet_stream(data):
+ mime = magic(data).mime_type
+ if mime == 'application/octet-stream':
+ raise KeyError
+ return decode(data, mime)
decoders = {
'application/gzip': gzip2xml,