aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2016-06-05 12:53:41 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2016-07-05 22:15:57 +0200
commit05de3b759fe75e2f6839d8e855c304239f97eec1 (patch)
treebc464dbcadff133a9336e24138f256e4e275c01b
parentba9851db027a5c1cc6060274fbaf8b76b57ecb46 (diff)
downloadmitmproxy-05de3b759fe75e2f6839d8e855c304239f97eec1.tar.gz
mitmproxy-05de3b759fe75e2f6839d8e855c304239f97eec1.tar.bz2
mitmproxy-05de3b759fe75e2f6839d8e855c304239f97eec1.zip
http2: remove forbidden headers
E.g.: send_error_reponse sets a connection header
-rw-r--r--mitmproxy/protocol/http2.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mitmproxy/protocol/http2.py b/mitmproxy/protocol/http2.py
index 19c7c604..9515eef9 100644
--- a/mitmproxy/protocol/http2.py
+++ b/mitmproxy/protocol/http2.py
@@ -478,6 +478,9 @@ class Http2SingleStreamLayer(http._HttpTransmissionLayer, basethread.BaseThread)
def send_response_headers(self, response):
headers = response.headers.copy()
headers.insert(0, ":status", str(response.status_code))
+ for forbidden_header in h2.utilities.CONNECTION_HEADERS:
+ if forbidden_header in headers:
+ del headers[forbidden_header]
with self.client_conn.h2.lock:
self.client_conn.h2.safe_send_headers(
self.is_zombie,