comparison mercurial/hgweb/hgweb_mod.py @ 34605:625202a44d88

configitems: register the 'web.cache' config
author Boris Feld <boris.feld@octobus.net>
date Wed, 11 Oct 2017 04:14:33 +0200
parents 56816cfc4951
children c879fc7bd71f
comparison
equal deleted inserted replaced
34604:dcd6b6625e98 34605:625202a44d88
434 req.form['cmd'] = [tmpl.cache['default']] 434 req.form['cmd'] = [tmpl.cache['default']]
435 cmd = req.form['cmd'][0] 435 cmd = req.form['cmd'][0]
436 436
437 # Don't enable caching if using a CSP nonce because then it wouldn't 437 # Don't enable caching if using a CSP nonce because then it wouldn't
438 # be a nonce. 438 # be a nonce.
439 if rctx.configbool('web', 'cache', True) and not rctx.nonce: 439 if rctx.configbool('web', 'cache') and not rctx.nonce:
440 caching(self, req) # sets ETag header or raises NOT_MODIFIED 440 caching(self, req) # sets ETag header or raises NOT_MODIFIED
441 if cmd not in webcommands.__all__: 441 if cmd not in webcommands.__all__:
442 msg = 'no such method: %s' % cmd 442 msg = 'no such method: %s' % cmd
443 raise ErrorResponse(HTTP_BAD_REQUEST, msg) 443 raise ErrorResponse(HTTP_BAD_REQUEST, msg)
444 elif cmd == 'file' and 'raw' in req.form.get('style', []): 444 elif cmd == 'file' and 'raw' in req.form.get('style', []):