Patchwork [07,of,12] serve: don't remove headers that couldn't be removed correctly if they appeared

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 11, 2013, 11:32 p.m.
Message ID <618a5e70cd67c258ee08.1357947171@mk-desktop>
Download mbox | patch
Permalink /patch/566/
State Rejected
Headers show

Comments

Mads Kiilerich - Jan. 11, 2013, 11:32 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1357947109 -3600
# Node ID 618a5e70cd67c258ee08a63036b9733a5ee71b4f
# Parent  6f13eaaf47953e4f05a48e32449e53032feb479e
serve: don't remove headers that couldn't be removed correctly if they appeared

- and Transfer-Encoding is very likely to appear soon.

Patch

diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py
+++ b/mercurial/hgweb/server.py
@@ -157,12 +157,8 @@ 
         self.sent_headers = True
 
     def _start_response(self, http_status, headers, exc_info=None):
-        code, msg = http_status.split(None, 1)
-        code = int(code)
         self.saved_status = http_status
-        bad_headers = ('connection', 'transfer-encoding')
-        self.saved_headers = [h for h in headers
-                              if h[0].lower() not in bad_headers]
+        self.saved_headers = headers
         return self._write
 
     def _write(self, data):