diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-10 13:17:18 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-10 13:17:18 +1200 |
commit | 52779d9db98dff042a0b2b5dca97440b520367df (patch) | |
tree | ecaed5067234758e7da28f7e21e908c7a948aa51 /libmproxy/flow.py | |
parent | 55ddf853cd8cac13bb6021ef92d21af85cb9b2f1 (diff) | |
download | mitmproxy-52779d9db98dff042a0b2b5dca97440b520367df.tar.gz mitmproxy-52779d9db98dff042a0b2b5dca97440b520367df.tar.bz2 mitmproxy-52779d9db98dff042a0b2b5dca97440b520367df.zip |
Refactoring of proxy.py
- Correctly pass HTTP request version on to upstream servers
- Adjust tests not to hang due to a pathod response with no content-length
Diffstat (limited to 'libmproxy/flow.py')
-rw-r--r-- | libmproxy/flow.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 549942a5..b33707ca 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -536,7 +536,6 @@ class Request(HTTPMsg): 'proxy-connection', 'keep-alive', 'connection', - 'content-length', 'transfer-encoding' ] ) @@ -551,15 +550,15 @@ class Request(HTTPMsg): headers["connection"] = ["close"] if not _proxy: return FMT % ( - self.method, - self.path, + self.method, + self.path, self.httpversion[0], self.httpversion[1], - str(headers), + str(headers), content ) else: - return FMT_PROXY % ( + return FMT_PROXY % ( self.method, self.scheme, self.host, @@ -738,7 +737,7 @@ class Response(HTTPMsg): headers = self.headers.copy() utils.del_all( headers, - ['proxy-connection', 'connection', 'keep-alive', 'transfer-encoding'] + ['proxy-connection', 'transfer-encoding'] ) content = self.content if content: |