From c0e6c219cad033c4b9b8476d3827cce8de403042 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Fri, 28 Apr 2017 11:12:17 -0700 Subject: [PATCH] python2 fixes --- setup.py | 2 +- warcprox/mitmproxy.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 547e1fa..7734d50 100755 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ except: setuptools.setup( name='warcprox', - version='2.1b1.dev72', + version='2.1b1.dev73', description='WARC writing MITM HTTP/S proxy', url='https://github.com/internetarchive/warcprox', author='Noah Levitt', diff --git a/warcprox/mitmproxy.py b/warcprox/mitmproxy.py index d69f26e..e79746e 100644 --- a/warcprox/mitmproxy.py +++ b/warcprox/mitmproxy.py @@ -163,9 +163,9 @@ class ProxyingRecordingHTTPResponse(http_client.HTTPResponse): status_and_headers = 'HTTP/1.1 {} {}\r\n'.format( self.status, self.reason) - self.headers['Via'] = via_header_value( - self.headers.get('Via'), '%0.1f' % (self.version / 10)) - for k,v in self.headers.items(): + self.msg['Via'] = via_header_value( + self.msg.get('Via'), '%0.1f' % (self.version / 10.0)) + for k,v in self.msg.items(): if k.lower() not in ( 'connection', 'proxy-connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'upgrade',