aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-08-02 15:43:35 +1200
committerAldo Cortesi <aldo@nullcube.com>2011-08-02 15:43:35 +1200
commit17835b9b78ae08f84a97e1128c23d85eab74c339 (patch)
treec7a12814ac729bc3e4e644882c255029e37d7195 /libmproxy
parenta1456742a8dbb67782b4694485a1d5bb655c038a (diff)
downloadmitmproxy-17835b9b78ae08f84a97e1128c23d85eab74c339.tar.gz
mitmproxy-17835b9b78ae08f84a97e1128c23d85eab74c339.tar.bz2
mitmproxy-17835b9b78ae08f84a97e1128c23d85eab74c339.zip
Fix a rare undefined variable crash in proxy.py.
Diffstat (limited to 'libmproxy')
-rw-r--r--libmproxy/proxy.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index a2805069..6707b65b 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -749,7 +749,9 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
port = 80
port = int(port)
if host is None:
- raise ProxyError(400, 'Invalid request: %s'%request)
+ # FIXME: We only specify the first part of the invalid request in this error.
+ # We should gather up everything read from the socket, and specify it all.
+ raise ProxyError(400, 'Invalid request: %s'%line)
if "expect" in headers:
expect = ",".join(headers['expect'])
if expect == "100-continue" and httpminor >= 1: