hgweb: remove wsgirequest.form (API)
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 10 Mar 2018 12:31:11 -0800
changeset 36866 cf69df7ea385
parent 36865 3d60a22e27f5
child 36867 a755fd3b7146
hgweb: remove wsgirequest.form (API) Now that everything is ported to consume from parsedrequest.qsparams, we no longer have a need for wsgirequest.form. Let's remove all references to it. .. api:: The WSGI request object no longer exposes a ``form`` attribute containing parsed query string data. Use the ``qsparams`` attribute instead. Differential Revision: https://phab.mercurial-scm.org/D2782
mercurial/hgweb/hgweb_mod.py
mercurial/hgweb/request.py
--- a/mercurial/hgweb/hgweb_mod.py	Sat Mar 10 12:36:36 2018 -0800
+++ b/mercurial/hgweb/hgweb_mod.py	Sat Mar 10 12:31:11 2018 -0800
@@ -341,19 +341,15 @@
 
             # avoid accepting e.g. style parameter as command
             if util.safehasattr(webcommands, cmd):
-                wsgireq.form['cmd'] = [cmd]
                 req.qsparams['cmd'] = cmd
 
             if cmd == 'static':
-                wsgireq.form['file'] = ['/'.join(args)]
                 req.qsparams['file'] = '/'.join(args)
             else:
                 if args and args[0]:
                     node = args.pop(0).replace('%2F', '/')
-                    wsgireq.form['node'] = [node]
                     req.qsparams['node'] = node
                 if args:
-                    wsgireq.form['file'] = args
                     if 'file' in req.qsparams:
                         del req.qsparams['file']
                     for a in args:
@@ -368,9 +364,7 @@
                 for type_, spec in rctx.archivespecs.iteritems():
                     ext = spec[2]
                     if fn.endswith(ext):
-                        wsgireq.form['node'] = [fn[:-len(ext)]]
                         req.qsparams['node'] = fn[:-len(ext)]
-                        wsgireq.form['type'] = [type_]
                         req.qsparams['type'] = type_
         else:
             cmd = req.qsparams.get('cmd', '')
@@ -387,7 +381,6 @@
                 self.check_perm(rctx, wsgireq, None)
 
             if cmd == '':
-                wsgireq.form['cmd'] = [tmpl.cache['default']]
                 req.qsparams['cmd'] = tmpl.cache['default']
                 cmd = req.qsparams['cmd']
 
--- a/mercurial/hgweb/request.py	Sat Mar 10 12:36:36 2018 -0800
+++ b/mercurial/hgweb/request.py	Sat Mar 10 12:31:11 2018 -0800
@@ -426,7 +426,6 @@
         self.run_once = wsgienv[r'wsgi.run_once']
         self.env = wsgienv
         self.req = parserequestfromenv(wsgienv, inp)
-        self.form = self.req.qsparams.asdictoflists()
         self.res = wsgiresponse(self.req, start_response)
         self._start_response = start_response
         self.server_write = None