mitmproxy/examples/addons/http-add-header.py

14 lines
250 B
Python
Raw Normal View History

"""Add an HTTP header to each response."""
class AddHeader:
def __init__(self):
self.num = 0
def response(self, flow):
self.num = self.num + 1
flow.response.headers["count"] = str(self.num)
2022-04-26 11:53:35 +00:00
addons = [AddHeader()]