mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
set method when creating ProxyingRecordingHTTPResponse so that it knows when to close the connection, and HEAD requests don't sit around trying to read more data until socket timeout
This commit is contained in:
parent
11e11f4e68
commit
b2f08535ae
2
setup.py
2
setup.py
@ -51,7 +51,7 @@ except:
|
||||
|
||||
setuptools.setup(
|
||||
name='warcprox',
|
||||
version='2.1b1.dev74',
|
||||
version='2.1b1.dev75',
|
||||
description='WARC writing MITM HTTP/S proxy',
|
||||
url='https://github.com/internetarchive/warcprox',
|
||||
author='Noah Levitt',
|
||||
|
@ -397,7 +397,7 @@ class MitmProxyHandler(http_server.BaseHTTPRequestHandler):
|
||||
prox_rec_res = ProxyingRecordingHTTPResponse(
|
||||
self._remote_server_sock, proxy_client=self.connection,
|
||||
digest_algorithm=self.server.digest_algorithm,
|
||||
url=self.url)
|
||||
url=self.url, method=self.command)
|
||||
prox_rec_res.begin()
|
||||
|
||||
buf = prox_rec_res.read(8192)
|
||||
@ -405,9 +405,6 @@ class MitmProxyHandler(http_server.BaseHTTPRequestHandler):
|
||||
buf = prox_rec_res.read(8192)
|
||||
|
||||
self.log_request(prox_rec_res.status, prox_rec_res.recorder.len)
|
||||
except socket.timeout as e:
|
||||
self.logger.warn(
|
||||
"%s proxying %s %s", repr(e), self.command, self.url)
|
||||
except Exception as e:
|
||||
self.logger.error(
|
||||
"%s proxying %s %s", repr(e), self.command, self.url,
|
||||
|
Loading…
x
Reference in New Issue
Block a user