Patchwork D2828: hgweb: pass modern request type into templater()

login
register
mail settings
Submitter phabricator
Date March 12, 2018, 9:43 p.m.
Message ID <499cea7786f56dfa6f9df790a5e2f2ef@localhost.localdomain>
Download mbox | patch
Permalink /patch/29403/
State Not Applicable
Headers show

Comments

phabricator - March 12, 2018, 9:43 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6a0e4efbc61e: hgweb: pass modern request type into templater() (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2828?vs=6894&id=6959

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

AFFECTED FILES
  mercurial/hgweb/hgwebdir_mod.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -369,7 +369,7 @@ 
                 wsgireq.headers.append(('Content-Security-Policy', csp))
 
             virtual = req.dispatchpath.strip('/')
-            tmpl = self.templater(wsgireq, nonce)
+            tmpl = self.templater(req, nonce)
             ctype = tmpl('mimetype', encoding=encoding.encoding)
             ctype = templater.stringify(ctype)
 
@@ -485,7 +485,7 @@ 
 
         return res.sendresponse()
 
-    def templater(self, wsgireq, nonce):
+    def templater(self, req, nonce):
 
         def motd(**map):
             if self.motd is not None:
@@ -497,23 +497,23 @@ 
             return self.ui.config(section, name, default, untrusted)
 
         vars = {}
-        styles, (style, mapfile) = hgweb_mod.getstyle(wsgireq.req, config,
+        styles, (style, mapfile) = hgweb_mod.getstyle(req, config,
                                                       self.templatepath)
         if style == styles[0]:
             vars['style'] = style
 
         sessionvars = webutil.sessionvars(vars, r'?')
         logourl = config('web', 'logourl')
         logoimg = config('web', 'logoimg')
         staticurl = (config('web', 'staticurl')
-                     or wsgireq.req.apppath + '/static/')
+                     or req.apppath + '/static/')
         if not staticurl.endswith('/'):
             staticurl += '/'
 
         defaults = {
             "encoding": encoding.encoding,
             "motd": motd,
-            "url": wsgireq.req.apppath + '/',
+            "url": req.apppath + '/',
             "logourl": logourl,
             "logoimg": logoimg,
             "staticurl": staticurl,