Skip to content

Commit

Permalink
Changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeeky committed Oct 7, 2022
1 parent 9c0fb4d commit b43d752
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions plugins/malleable_redirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b43d752

Please sign in to comment.