From c02c98e369b978bfe8f08095422bab3ce6d995c7 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Mon, 7 Sep 2015 00:27:17 +0000 Subject: [PATCH] make sure warc headers are bytes --- warcprox/warcproxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/warcprox/warcproxy.py b/warcprox/warcproxy.py index ef95d28..b1772ac 100644 --- a/warcprox/warcproxy.py +++ b/warcprox/warcproxy.py @@ -280,7 +280,7 @@ class WarcProxyHandler(warcprox.mitmproxy.MitmProxyHandler): remote_ip=b'', warcprox_meta=warcprox_meta, content_type=self.headers['Content-Type'], - custom_type=warc_type or self.headers['WARC-Type'], + custom_type=warc_type or self.headers['WARC-Type'].encode('utf-8'), status=204, size=len(request_data), client_ip=self.client_address[0], method=self.command, timestamp=timestamp)