diff options
| author | John Vandenberg <jayvdb@gmail.com> | 2015-10-21 09:09:22 +1100 |
|---|---|---|
| committer | John Vandenberg <jayvdb@gmail.com> | 2015-11-02 21:27:37 +1100 |
| commit | cb7910785f673669507fdbcb303d3d21be035f84 (patch) | |
| tree | ee41aaf29787b68600439dd61772d5915940e280 /dummyserver/proxy.py | |
| parent | 3bd63406bef7c16d007c17563b6af14582567d4b (diff) | |
| download | urllib3-cb7910785f673669507fdbcb303d3d21be035f84.tar.gz | |
Fix flake8 violations
Add tox rule to prevent regressions.
Diffstat (limited to 'dummyserver/proxy.py')
| -rwxr-xr-x | dummyserver/proxy.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/dummyserver/proxy.py b/dummyserver/proxy.py index aca92a70..5b9984d1 100755 --- a/dummyserver/proxy.py +++ b/dummyserver/proxy.py @@ -45,14 +45,14 @@ class ProxyHandler(tornado.web.RequestHandler): def handle_response(response): if response.error and not isinstance(response.error, - tornado.httpclient.HTTPError): + tornado.httpclient.HTTPError): self.set_status(500) self.write('Internal server error:\n' + str(response.error)) self.finish() else: self.set_status(response.code) for header in ('Date', 'Cache-Control', 'Server', - 'Content-Type', 'Location'): + 'Content-Type', 'Location'): v = response.headers.get(header) if v: self.set_header(header, v) @@ -60,7 +60,8 @@ class ProxyHandler(tornado.web.RequestHandler): self.write(response.body) self.finish() - req = tornado.httpclient.HTTPRequest(url=self.request.uri, + req = tornado.httpclient.HTTPRequest( + url=self.request.uri, method=self.request.method, body=self.request.body, headers=self.request.headers, follow_redirects=False, allow_nonstandard_methods=True) @@ -133,5 +134,5 @@ if __name__ == '__main__': if len(sys.argv) > 1: port = int(sys.argv[1]) - print ("Starting HTTP proxy on port %d" % port) + print("Starting HTTP proxy on port %d" % port) run_proxy(port) |
