python2 fixes

This commit is contained in:
Noah Levitt 2017-04-28 11:12:17 -07:00
parent 338e5cd878
commit c0e6c219ca
2 changed files with 4 additions and 4 deletions

View File

@ -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',

View File

@ -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',