mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
Changes
This commit is contained in:
parent
61617919ff
commit
79b8fcc052
@ -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()
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user