diff mercurial/wireprotoserver.py @ 36848:16292bbda39c

hgweb: store and use request method on parsed request PEP 3333 says that REQUEST_METHOD is always defined. Differential Revision: https://phab.mercurial-scm.org/D2745
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 10 Mar 2018 10:44:56 -0800
parents ed0456fde625
children 0bc771bba220
line wrap: on
line diff
--- a/mercurial/wireprotoserver.py	Sat Mar 10 10:45:12 2018 -0800
+++ b/mercurial/wireprotoserver.py	Sat Mar 10 10:44:56 2018 -0800
@@ -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()