Patchwork D2797: hgweb: stop setting headers on wsgirequest

login
register
mail settings
Submitter phabricator
Date March 12, 2018, 9:34 p.m.
Message ID <11a5bd298deeb2032dc88876c4cdac9b@localhost.localdomain>
Download mbox | patch
Permalink /patch/29374/
State Not Applicable
Headers show

Comments

phabricator - March 12, 2018, 9:34 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG96a93625a824: hgweb: stop setting headers on wsgirequest (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2797?vs=6858&id=6933

REVISION DETAIL
  https://phab.mercurial-scm.org/D2797

AFFECTED FILES
  mercurial/hgweb/hgweb_mod.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -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__: