Fix a rare undefined variable crash in proxy.py.

This commit is contained in:
Aldo Cortesi 2011-08-02 15:43:35 +12:00
parent a1456742a8
commit 17835b9b78
1 changed files with 3 additions and 1 deletions

View File

@ -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: