aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2010-02-26 20:07:37 +1300
committerAldo Cortesi <aldo@nullcube.com>2010-02-26 20:07:37 +1300
commitc5eb3c592d16fa33ba57157aefc2612208d0ff10 (patch)
treeaee8200b2657a6d59793025664eadfc80bc6fcfe /libmproxy/proxy.py
parent0e76f0f341f367abd3e317f48612071843977f3f (diff)
downloadmitmproxy-c5eb3c592d16fa33ba57157aefc2612208d0ff10.tar.gz
mitmproxy-c5eb3c592d16fa33ba57157aefc2612208d0ff10.tar.bz2
mitmproxy-c5eb3c592d16fa33ba57157aefc2612208d0ff10.zip
Fix hang when a POST is made with a 0 content length.
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r--libmproxy/proxy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index c2a9b494..6196dc0e 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -320,7 +320,7 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
headers.read(self.rfile)
if method == 'POST' and not headers.has_key('content-length'):
raise ProxyError(400, "Missing Content-Length for POST method")
- if headers.has_key("content-length"):
+ if headers.has_key("content-length") and int(headers["content-length"][0]):
content = self.rfile.read(int(headers["content-length"][0]))
else:
content = ""