D2310: wireprotoserver: py3 helpfully calls adds HTTP_ to CONTENT_LENGTH

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Feb 18 07:47:06 EST 2018


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

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))



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


More information about the Mercurial-devel mailing list