hgweb: stop setting headers on wsgirequest
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 10 Mar 2018 19:08:58 -0800
changeset 36887 96a93625a824
parent 36886 67fb0dca29bc
child 36888 66f62d120ba2
hgweb: stop setting headers on wsgirequest All commands now go through the new response API. This is dead code. Differential Revision: https://phab.mercurial-scm.org/D2797
mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Sat Mar 10 20:35:35 2018 -0800
+++ b/mercurial/hgweb/hgweb_mod.py	Sat Mar 10 19:08:58 2018 -0800
@@ -313,9 +313,6 @@
         if rctx.csp:
             # hgwebdir may have added CSP header. Since we generate our own,
             # replace it.
-            wsgireq.headers = [h for h in wsgireq.headers
-                               if h[0] != 'Content-Security-Policy']
-            wsgireq.headers.append(('Content-Security-Policy', rctx.csp))
             res.headers['Content-Security-Policy'] = rctx.csp
 
         handled = wireprotoserver.handlewsgirequest(
@@ -393,7 +390,6 @@
                     res.setbodybytes('')
                     return res.sendresponse()
 
-                wsgireq.headers.append((r'ETag', pycompat.sysstr(tag)))
                 res.headers['ETag'] = tag
 
             if cmd not in webcommands.__all__: