aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorroot <skkaushik212@gmail.com>2020-03-31 10:07:53 +0530
committerroot <skkaushik212@gmail.com>2020-03-31 10:07:53 +0530
commit79b8fcc052f78f836dac2dcf0221097ff8c10c10 (patch)
treed1194460d997b4011cd830e2a35f54ab3b9a0f98 /test
parent61617919ffffd62ab42aa5fec8a9b5bf9b76f8e1 (diff)
downloadmitmproxy-79b8fcc052f78f836dac2dcf0221097ff8c10c10.tar.gz
mitmproxy-79b8fcc052f78f836dac2dcf0221097ff8c10c10.tar.bz2
mitmproxy-79b8fcc052f78f836dac2dcf0221097ff8c10c10.zip
Changes
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/data/addonscripts/configure.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/test/mitmproxy/data/addonscripts/configure.py b/test/mitmproxy/data/addonscripts/configure.py
index 64abba6e..6f6ac06a 100644
--- a/test/mitmproxy/data/addonscripts/configure.py
+++ b/test/mitmproxy/data/addonscripts/configure.py
@@ -1,27 +1,21 @@
import typing
-from mitmproxy import ctx
from mitmproxy import exceptions
-class TestHeader:
+class OptionAddon:
def load(self, loader):
loader.add_option(
- name = "testheader",
+ name = "optionaddon",
typespec = typing.Optional[int],
default = None,
- help = "test header",
+ help = "Option Addon",
)
def configure(self, updates):
raise exceptions.OptionsError("Options Error")
- def response(self, flow):
- if ctx.options.testheader is not None:
- flow.response.headers["testheader"] = str(ctx.options.testheader)
-
-
addons = [
- TestHeader()
+ OptionAddon()
]