From 04ee73b684a84353a97aa9bff2d6b0d23bd16b73 Mon Sep 17 00:00:00 2001 From: "Mariusz B. / mgeeky" Date: Fri, 7 Oct 2022 16:00:31 +0200 Subject: [PATCH] Changes. --- plugins/IProxyPlugin.py | 1 - plugins/malleable_redirector.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/IProxyPlugin.py b/plugins/IProxyPlugin.py index 53b5896..072f43d 100644 --- a/plugins/IProxyPlugin.py +++ b/plugins/IProxyPlugin.py @@ -12,7 +12,6 @@ 'override_host_header' : 'X-Proxy2-Override-Host-Header', 'domain_front_host_header' : 'X-Proxy2-Domain-Front-Host-Header', 'keep_alive_this_connection' : 'X-Proxy2-Keep-Alive', - 'remove_response_headers' : 'X-Proxy2-Remove-Response-Headers', } class DropConnectionException(Exception): diff --git a/plugins/malleable_redirector.py b/plugins/malleable_redirector.py index 2c1320c..84de246 100644 --- a/plugins/malleable_redirector.py +++ b/plugins/malleable_redirector.py @@ -1193,11 +1193,12 @@ def _response_handler(self, req, req_body, res, res_body): hdrs = '' for h in self.proxyOptions['remove_these_response_headers']: - if h in res.headers: + if h in res.headers.keys(): del res.headers[h] hdrs += h + ', ' - self.logger.dbg('Removed these response headers: ' + hdrs) + if len(hdrs) > 0: + self.logger.dbg('Removed these response headers: ' + hdrs) req.connection.no_keep_alive = False