Patchwork D3432: hgweb: guard against empty Content-Length header

login
register
mail settings
Submitter phabricator
Date April 30, 2018, 2:48 p.m.
Message ID <e26934eccf43b662da12dfa0505b89fd@localhost.localdomain>
Download mbox | patch
Permalink /patch/31245/
State Not Applicable
Headers show

Comments

phabricator - April 30, 2018, 2:48 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe82b137a8b4e: hgweb: guard against empty Content-Length header (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3432?vs=8439&id=8440

REVISION DETAIL
  https://phab.mercurial-scm.org/D3432

AFFECTED FILES
  mercurial/hgweb/request.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, durin42
Cc: mharbison72, mercurial-devel

Patch

diff --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py
--- a/mercurial/hgweb/request.py
+++ b/mercurial/hgweb/request.py
@@ -313,7 +313,8 @@ 
     if bodyfh is None:
         bodyfh = env['wsgi.input']
         if 'Content-Length' in headers:
-            bodyfh = util.cappedreader(bodyfh, int(headers['Content-Length']))
+            bodyfh = util.cappedreader(bodyfh,
+                                       int(headers['Content-Length'] or '0'))
 
     return parsedrequest(method=env['REQUEST_METHOD'],
                          url=fullurl, baseurl=baseurl,