aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r--libmproxy/proxy.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index 3be20761..7698a61f 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -309,6 +309,9 @@ class ServerConnection:
if not len(parts) == 3:
raise ProxyError(502, "Invalid server response: %s."%line)
proto, code, msg = parts
+ httpversion = parse_http_protocol(proto)
+ if httpversion is None:
+ raise ProxyError(502, "Invalid HTTP version: %s."%httpversion)
try:
code = int(code)
except ValueError:
@@ -320,7 +323,7 @@ class ServerConnection:
content = ""
else:
content = read_http_body(self.rfile, self, headers, True, self.config.body_size_limit)
- return flow.Response(request, code, msg, headers, content, self.cert)
+ return flow.Response(request, httpversion, code, msg, headers, content, self.cert)
def terminate(self):
try: