# HG changeset patch # User Augie Fackler # Date 2018-02-18 05:02:33 # Node ID 685bcdd236b592bb7c84290268decfb675bbd5ca # Parent 1e0c9f9f6f36618392ec2f9b0a675b3b12f08565 wireprotoserver: py3 helpfully calls adds HTTP_ to CONTENT_LENGTH Just handle both with a membership check, preferring the HTTP_ namespaced version. Sigh. Differential Revision: https://phab.mercurial-scm.org/D2310 diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -142,7 +142,10 @@ class httpv1protocolhandler(baseprotocol 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))