diff -r fa7e30efe05a -r 3c91cc0c5fde mercurial/hgweb/protocol.py --- a/mercurial/hgweb/protocol.py Tue Aug 15 21:09:33 2017 +0900 +++ b/mercurial/hgweb/protocol.py Wed Jul 26 17:58:19 2017 -0400 @@ -75,6 +75,9 @@ return args def getfile(self, fp): length = int(self.req.env['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('HTTP_X_HGARGS_POST', 0)) for s in util.filechunkiter(self.req, limit=length): fp.write(s) def redirect(self):