Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgwebdir_mod.py @ 36909:803e0fc0cc9a
hgweb: replace PATH_INFO with dispatchpath
This was the last consumer of wsgireq.env from our WSGI applications!
(Although indirect consumers of this attribute exist in
wsgirequest.respond().)
Differential Revision: https://phab.mercurial-scm.org/D2825
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 11 Mar 2018 15:18:29 -0700 |
parents | e473a032f38a |
children | 092ab4ba7ee5 |
comparison
equal
deleted
inserted
replaced
36908:e473a032f38a | 36909:803e0fc0cc9a |
---|---|
367 csp, nonce = cspvalues(self.ui) | 367 csp, nonce = cspvalues(self.ui) |
368 if csp: | 368 if csp: |
369 res.headers['Content-Security-Policy'] = csp | 369 res.headers['Content-Security-Policy'] = csp |
370 wsgireq.headers.append(('Content-Security-Policy', csp)) | 370 wsgireq.headers.append(('Content-Security-Policy', csp)) |
371 | 371 |
372 virtual = wsgireq.env.get("PATH_INFO", "").strip('/') | 372 virtual = req.dispatchpath.strip('/') |
373 tmpl = self.templater(wsgireq, nonce) | 373 tmpl = self.templater(wsgireq, nonce) |
374 ctype = tmpl('mimetype', encoding=encoding.encoding) | 374 ctype = tmpl('mimetype', encoding=encoding.encoding) |
375 ctype = templater.stringify(ctype) | 375 ctype = templater.stringify(ctype) |
376 | 376 |
377 # Global defaults. These can be overridden by any handler. | 377 # Global defaults. These can be overridden by any handler. |