deal with empty Content-Length headers stable
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Sat, 12 Mar 2011 15:21:45 +0100
branchstable
changeset 13598 e5d3c7083d91
parent 13597 38c9837b1f75
child 13600 bcc59cb3714d
deal with empty Content-Length headers
mercurial/hgweb/request.py
--- a/mercurial/hgweb/request.py	Sat Mar 12 11:20:03 2011 +0100
+++ b/mercurial/hgweb/request.py	Sat Mar 12 15:21:45 2011 +0100
@@ -66,7 +66,7 @@
 
     def drain(self):
         '''need to read all data from request, httplib is half-duplex'''
-        length = int(self.env.get('CONTENT_LENGTH', 0))
+        length = int(self.env.get('CONTENT_LENGTH', 0) or 0)
         for s in util.filechunkiter(self.inp, limit=length):
             pass