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