mercurial/hgweb/protocol.py
changeset 33821 3c91cc0c5fde
parent 33228 35c233975b78
child 34509 e21f274cccea
--- 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):