From 34c1a58034d5c47e1ca4a294e143e37e16c21c55 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Wed, 11 Dec 2019 02:34:56 +0000 Subject: [PATCH] Fix detection of multiple transfer encodings --- warc-tiny | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/warc-tiny b/warc-tiny index 1b9ef50..d4b2525 100755 --- a/warc-tiny +++ b/warc-tiny @@ -140,7 +140,7 @@ def iter_warc(f): gzipped = False if b'\r\ntransfer-encoding' in httpHeaders.lower(): transferEncoding = next(x[1] for x in httpHeaderLines if x[0].lower() == b'transfer-encoding') - transferEncodings = map(bytes.strip, transferEncoding.split(b',')) + transferEncodings = set(map(bytes.strip, transferEncoding.split(b','))) chunked = b'chunked' in transferEncodings gzipped = b'gzip' in transferEncodings