indygreg updated this revision to Diff 6830.
indygreg edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2768?vs=6812&id=6830

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

AFFECTED FILES
  mercurial/hgweb/request.py

CHANGE DETAILS

diff --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py
--- a/mercurial/hgweb/request.py
+++ b/mercurial/hgweb/request.py
@@ -234,6 +234,14 @@
             raise RuntimeError("Unknown and unsupported WSGI version %d.%d"
                                % version)
         self.inp = wsgienv[r'wsgi.input']
+
+        if r'HTTP_CONTENT_LENGTH' in wsgienv:
+            self.inp = util.cappedreader(self.inp,
+                                         int(wsgienv[r'HTTP_CONTENT_LENGTH']))
+        elif r'CONTENT_LENGTH' in wsgienv:
+            self.inp = util.cappedreader(self.inp,
+                                         int(wsgienv[r'CONTENT_LENGTH']))
+
         self.err = wsgienv[r'wsgi.errors']
         self.threaded = wsgienv[r'wsgi.multithread']
         self.multiprocess = wsgienv[r'wsgi.multiprocess']



To: indygreg, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to