From 52779d9db98dff042a0b2b5dca97440b520367df Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 10 Jun 2012 13:17:18 +1200 Subject: 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 --- libmproxy/flow.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'libmproxy/flow.py') 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: -- cgit v1.2.3