mercurial/hgweb/common.py
changeset 36869 7ad6a275316f
parent 36853 7066617187c1
child 36873 98baf8dea553
equal deleted inserted replaced
36868:8ddb5c354906 36869:7ad6a275316f
   212     """
   212     """
   213     return (config("web", "contact") or
   213     return (config("web", "contact") or
   214             config("ui", "username") or
   214             config("ui", "username") or
   215             encoding.environ.get("EMAIL") or "")
   215             encoding.environ.get("EMAIL") or "")
   216 
   216 
   217 def caching(web, req):
       
   218     tag = r'W/"%d"' % web.mtime
       
   219     if req.env.get('HTTP_IF_NONE_MATCH') == tag:
       
   220         raise ErrorResponse(HTTP_NOT_MODIFIED)
       
   221     req.headers.append(('ETag', tag))
       
   222 
       
   223 def cspvalues(ui):
   217 def cspvalues(ui):
   224     """Obtain the Content-Security-Policy header and nonce value.
   218     """Obtain the Content-Security-Policy header and nonce value.
   225 
   219 
   226     Returns a 2-tuple of the CSP header value and the nonce value.
   220     Returns a 2-tuple of the CSP header value and the nonce value.
   227 
   221