equal
deleted
inserted
replaced
33 hg, |
33 hg, |
34 profiling, |
34 profiling, |
35 pycompat, |
35 pycompat, |
36 scmutil, |
36 scmutil, |
37 templater, |
37 templater, |
38 templateutil, |
|
39 ui as uimod, |
38 ui as uimod, |
40 util, |
39 util, |
41 ) |
40 ) |
42 |
41 |
43 from . import ( |
42 from . import ( |
379 if csp: |
378 if csp: |
380 res.headers['Content-Security-Policy'] = csp |
379 res.headers['Content-Security-Policy'] = csp |
381 |
380 |
382 virtual = req.dispatchpath.strip('/') |
381 virtual = req.dispatchpath.strip('/') |
383 tmpl = self.templater(req, nonce) |
382 tmpl = self.templater(req, nonce) |
384 ctype = tmpl('mimetype', encoding=encoding.encoding) |
383 ctype = tmpl.render('mimetype', {'encoding': encoding.encoding}) |
385 ctype = templateutil.stringify(ctype) |
|
386 |
384 |
387 # Global defaults. These can be overridden by any handler. |
385 # Global defaults. These can be overridden by any handler. |
388 res.status = '200 Script output follows' |
386 res.status = '200 Script output follows' |
389 res.headers['Content-Type'] = ctype |
387 res.headers['Content-Type'] = ctype |
390 |
388 |