Mercurial

changeset 13598:e5d3c7083d91 stable

deal with empty Content-Length headers
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sat, 12 Mar 2011 15:21:45 +0100
parents 38c9837b1f75
children bcc59cb3714d
files mercurial/hgweb/request.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/mercurial/hgweb/request.py	Sat Mar 12 11:20:03 2011 +0100
     1.2 +++ b/mercurial/hgweb/request.py	Sat Mar 12 15:21:45 2011 +0100
     1.3 @@ -66,7 +66,7 @@
     1.4  
     1.5      def drain(self):
     1.6          '''need to read all data from request, httplib is half-duplex'''
     1.7 -        length = int(self.env.get('CONTENT_LENGTH', 0))
     1.8 +        length = int(self.env.get('CONTENT_LENGTH', 0) or 0)
     1.9          for s in util.filechunkiter(self.inp, limit=length):
    1.10              pass
    1.11