From b43d7527364806f96f05f80f69d06cc931acbb4b Mon Sep 17 00:00:00 2001 From: "Mariusz B. / mgeeky" Date: Fri, 7 Oct 2022 15:54:14 +0200 Subject: [PATCH] Changes. --- plugins/malleable_redirector.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/malleable_redirector.py b/plugins/malleable_redirector.py index 67972e6..2c1320c 100644 --- a/plugins/malleable_redirector.py +++ b/plugins/malleable_redirector.py @@ -1190,13 +1190,14 @@ def _response_handler(self, req, req_body, res, res_body): res.headers[proxy2_metadata_headers['override_response_content_encoding']] = 'identity' if 'remove_these_response_headers' in self.proxyOptions.keys() and len(self.proxyOptions['remove_these_response_headers']) > 0: - hdrs = ','.join([x.lower() for x in self.proxyOptions['remove_these_response_headers']]) - self.logger.dbg('Removing these response headers: ' + hdrs) + hdrs = '' - hdrsList = hdrs.split(',') - - for h in hdrsList: - del res.headers[h] + for h in self.proxyOptions['remove_these_response_headers']: + if h in res.headers: + del res.headers[h] + hdrs += h + ', ' + + self.logger.dbg('Removed these response headers: ' + hdrs) req.connection.no_keep_alive = False