Patchwork D2797: hgweb: stop setting headers on wsgirequest

login
register
mail settings
Submitter phabricator
Date March 11, 2018, 5:24 a.m.
Message ID <differential-rev-PHID-DREV-5gvpm5ppdc6ur3kbu6pj-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29288/
State Superseded
Headers show

Comments

phabricator - March 11, 2018, 5:24 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  All commands now go through the new response API. This is dead code.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/hgweb/hgweb_mod.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
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__: