Patchwork D2310: wireprotoserver: py3 helpfully calls adds HTTP_ to CONTENT_LENGTH

login
register
mail settings
Submitter phabricator
Date Feb. 18, 2018, 12:47 p.m.
Message ID <3b04c648017af7ff241edf25e7a3a069@localhost.localdomain>
Download mbox | patch
Permalink /patch/28071/
State Not Applicable
Headers show

Comments

phabricator - Feb. 18, 2018, 12:47 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG685bcdd236b5: wireprotoserver: py3 helpfully calls adds HTTP_ to CONTENT_LENGTH (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2310?vs=5828&id=5847

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

AFFECTED FILES
  mercurial/wireprotoserver.py

CHANGE DETAILS




To: durin42, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -142,7 +142,10 @@ 
         return args
 
     def forwardpayload(self, fp):
-        length = int(self._req.env[r'CONTENT_LENGTH'])
+        if r'HTTP_CONTENT_LENGTH' in self._req.env:
+            length = int(self._req.env[r'HTTP_CONTENT_LENGTH'])
+        else:
+            length = int(self._req.env[r'CONTENT_LENGTH'])
         # If httppostargs is used, we need to read Content-Length
         # minus the amount that was consumed by args.
         length -= int(self._req.env.get(r'HTTP_X_HGARGS_POST', 0))