diff mercurial/hgweb/hgweb_mod.py @ 36818:886fba199022

hgweb: only recognize wire protocol commands from query string (BC) Previously, we attempted to parse the wire protocol command from `req.form`. Data could have come from the query string or POST form data. The wire protocol states that the command must be declared in the query string. And AFAICT all Mercurial releases from at least 1.0 send the command in the query string. So let's actual require this behavior. This is technically BC. But I'm not sure how anyone in the wild would encounter this. POST has historically been used for sending bundle data. So there's no opportunity to encode arguments there. And the experimental HTTP POST args also takes over the body. So the only way someone would be impacted by this is if they wrote a custom client that both used POST for everything and sent arguments via the HTTP body. I don't believe such a client exists. .. bc:: The HTTP wire protocol server no longer accepts the ``cmd`` argument to control which command to run via HTTP POST bodies. The ``cmd`` argument must be specified on the URL query string. Differential Revision: https://phab.mercurial-scm.org/D2738
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 08 Mar 2018 11:33:33 -0800
parents 0031e972ded2
children cfb9ef24968c
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Thu Mar 08 11:21:46 2018 -0800
+++ b/mercurial/hgweb/hgweb_mod.py	Thu Mar 08 11:33:33 2018 -0800
@@ -330,7 +330,7 @@
 
         # Route it to a wire protocol handler if it looks like a wire protocol
         # request.
-        protohandler = wireprotoserver.parsehttprequest(rctx, wsgireq, query,
+        protohandler = wireprotoserver.parsehttprequest(rctx, wsgireq, req,
                                                         self.check_perm)
 
         if protohandler: