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

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2745?vs=6751&id=6825

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

AFFECTED FILES
  mercurial/hgweb/request.py
  mercurial/wireprotoserver.py

CHANGE DETAILS

diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -324,7 +324,7 @@
     # the HTTP response. In other words, it helps prevent deadlocks
     # on clients using httplib.
 
-    if (wsgireq.env[r'REQUEST_METHOD'] == r'POST' and
+    if (req.method == 'POST' and
         # But not if Expect: 100-continue is being used.
         (req.headers.get('Expect', '').lower() != '100-continue')):
         wsgireq.drain()
diff --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py
--- a/mercurial/hgweb/request.py
+++ b/mercurial/hgweb/request.py
@@ -63,6 +63,8 @@
 class parsedrequest(object):
     """Represents a parsed WSGI request / static HTTP request parameters."""
 
+    # Request method.
+    method = attr.ib()
     # Full URL for this request.
     url = attr.ib()
     # URL without any path components. Just <proto>://<host><port>.
@@ -207,7 +209,8 @@
     if 'CONTENT_LENGTH' in env and 'HTTP_CONTENT_LENGTH' not in env:
         headers['Content-Length'] = env['CONTENT_LENGTH']
 
-    return parsedrequest(url=fullurl, baseurl=baseurl,
+    return parsedrequest(method=env['REQUEST_METHOD'],
+                         url=fullurl, baseurl=baseurl,
                          advertisedurl=advertisedfullurl,
                          advertisedbaseurl=advertisedbaseurl,
                          apppath=apppath,



To: indygreg, #hg-reviewers, durin42
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