mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-28 18:50:42 +00:00
Fix hang when a POST is made with a 0 content length.
This commit is contained in:
parent
0e76f0f341
commit
c5eb3c592d
@ -320,7 +320,7 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
|
|||||||
headers.read(self.rfile)
|
headers.read(self.rfile)
|
||||||
if method == 'POST' and not headers.has_key('content-length'):
|
if method == 'POST' and not headers.has_key('content-length'):
|
||||||
raise ProxyError(400, "Missing Content-Length for POST method")
|
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]))
|
content = self.rfile.read(int(headers["content-length"][0]))
|
||||||
else:
|
else:
|
||||||
content = ""
|
content = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user