##// END OF EJS Templates
hgweb: pass modern request type into templater()...
Gregory Szorc -
r36922:6a0e4efb default
parent child Browse files
Show More
@@ -369,7 +369,7 b' class hgwebdir(object):'
369 wsgireq.headers.append(('Content-Security-Policy', csp))
369 wsgireq.headers.append(('Content-Security-Policy', csp))
370
370
371 virtual = req.dispatchpath.strip('/')
371 virtual = req.dispatchpath.strip('/')
372 tmpl = self.templater(wsgireq, nonce)
372 tmpl = self.templater(req, nonce)
373 ctype = tmpl('mimetype', encoding=encoding.encoding)
373 ctype = tmpl('mimetype', encoding=encoding.encoding)
374 ctype = templater.stringify(ctype)
374 ctype = templater.stringify(ctype)
375
375
@@ -485,7 +485,7 b' class hgwebdir(object):'
485
485
486 return res.sendresponse()
486 return res.sendresponse()
487
487
488 def templater(self, wsgireq, nonce):
488 def templater(self, req, nonce):
489
489
490 def motd(**map):
490 def motd(**map):
491 if self.motd is not None:
491 if self.motd is not None:
@@ -497,7 +497,7 b' class hgwebdir(object):'
497 return self.ui.config(section, name, default, untrusted)
497 return self.ui.config(section, name, default, untrusted)
498
498
499 vars = {}
499 vars = {}
500 styles, (style, mapfile) = hgweb_mod.getstyle(wsgireq.req, config,
500 styles, (style, mapfile) = hgweb_mod.getstyle(req, config,
501 self.templatepath)
501 self.templatepath)
502 if style == styles[0]:
502 if style == styles[0]:
503 vars['style'] = style
503 vars['style'] = style
@@ -506,14 +506,14 b' class hgwebdir(object):'
506 logourl = config('web', 'logourl')
506 logourl = config('web', 'logourl')
507 logoimg = config('web', 'logoimg')
507 logoimg = config('web', 'logoimg')
508 staticurl = (config('web', 'staticurl')
508 staticurl = (config('web', 'staticurl')
509 or wsgireq.req.apppath + '/static/')
509 or req.apppath + '/static/')
510 if not staticurl.endswith('/'):
510 if not staticurl.endswith('/'):
511 staticurl += '/'
511 staticurl += '/'
512
512
513 defaults = {
513 defaults = {
514 "encoding": encoding.encoding,
514 "encoding": encoding.encoding,
515 "motd": motd,
515 "motd": motd,
516 "url": wsgireq.req.apppath + '/',
516 "url": req.apppath + '/',
517 "logourl": logourl,
517 "logourl": logourl,
518 "logoimg": logoimg,
518 "logoimg": logoimg,
519 "staticurl": staticurl,
519 "staticurl": staticurl,
General Comments 0
You need to be logged in to leave comments. Login now