mercurial/hgweb/hgwebdir_mod.py
changeset 36989 de117f579431
parent 36978 c479692690ef
child 37019 c97b936d8bb5
equal deleted inserted replaced
36988:317382151ac3 36989:de117f579431
    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