mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
options.rheaders -> options.server_replay_use_headers
This commit is contained in:
parent
b0213a2c0e
commit
5ebe8c1bc8
@ -61,9 +61,9 @@ class ServerPlayback(object):
|
||||
key.append(p[0])
|
||||
key.append(p[1])
|
||||
|
||||
if self.options.rheaders:
|
||||
if self.options.server_replay_use_headers:
|
||||
headers = []
|
||||
for i in self.options.rheaders:
|
||||
for i in self.options.server_replay_use_headers:
|
||||
v = r.headers.get(i)
|
||||
headers.append((i, v))
|
||||
key.append(headers)
|
||||
@ -101,7 +101,7 @@ class ServerPlayback(object):
|
||||
# prefixed with serverplayback_ where appropriate, and playback_ where
|
||||
# they're shared with client playback.
|
||||
#
|
||||
# options.rheaders,
|
||||
# options.server_replay_use_headers,
|
||||
# options.nopop,
|
||||
# options.replay_ignore_params,
|
||||
# options.replay_ignore_content,
|
||||
|
@ -221,7 +221,7 @@ def get_common_options(args):
|
||||
replay_kill_extra=args.replay_kill_extra,
|
||||
no_server=args.no_server,
|
||||
refresh_server_playback=not args.norefresh,
|
||||
rheaders=args.rheaders,
|
||||
server_replay_use_headers=args.server_replay_use_headers,
|
||||
rfile=args.rfile,
|
||||
replacements=reps,
|
||||
setheaders=setheaders,
|
||||
@ -599,8 +599,8 @@ def server_replay(parser):
|
||||
help="Kill extra requests during replay."
|
||||
)
|
||||
group.add_argument(
|
||||
"--rheader",
|
||||
action="append", dest="rheaders", type=str,
|
||||
"--server-replay-use-header",
|
||||
action="append", dest="server_replay_use_headers", type=str,
|
||||
help="Request headers to be considered during replay. "
|
||||
"Can be passed multiple times."
|
||||
)
|
||||
|
@ -148,7 +148,7 @@ class ConnectionItem(urwid.WidgetWrap):
|
||||
if k == "a":
|
||||
self.master.start_server_playback(
|
||||
[i.copy() for i in self.master.state.view],
|
||||
self.master.options.replay_kill_extra, self.master.options.rheaders,
|
||||
self.master.options.replay_kill_extra, self.master.options.server_replay_use_headers,
|
||||
False, self.master.options.nopop,
|
||||
self.master.options.replay_ignore_params,
|
||||
self.master.options.replay_ignore_content,
|
||||
@ -158,7 +158,7 @@ class ConnectionItem(urwid.WidgetWrap):
|
||||
elif k == "t":
|
||||
self.master.start_server_playback(
|
||||
[self.flow.copy()],
|
||||
self.master.options.replay_kill_extra, self.master.options.rheaders,
|
||||
self.master.options.replay_kill_extra, self.master.options.server_replay_use_headers,
|
||||
False, self.master.options.nopop,
|
||||
self.master.options.replay_ignore_params,
|
||||
self.master.options.replay_ignore_content,
|
||||
|
@ -39,7 +39,7 @@ class Options(optmanager.OptManager):
|
||||
scripts=(), # type: Sequence[str]
|
||||
showhost=False, # type: bool
|
||||
replacements=(), # type: Sequence[Tuple[str, str, str]]
|
||||
rheaders=(), # type: Sequence[str]
|
||||
server_replay_use_headers=(), # type: Sequence[str]
|
||||
setheaders=(), # type: Sequence[Tuple[str, str, str]]
|
||||
server_replay=None, # type: Optional[str]
|
||||
stickycookie=None, # type: Optional[str]
|
||||
@ -97,7 +97,7 @@ class Options(optmanager.OptManager):
|
||||
self.scripts = scripts
|
||||
self.showhost = showhost
|
||||
self.replacements = replacements
|
||||
self.rheaders = rheaders
|
||||
self.server_replay_use_headers = server_replay_use_headers
|
||||
self.setheaders = setheaders
|
||||
self.server_replay = server_replay
|
||||
self.stickycookie = stickycookie
|
||||
|
@ -127,7 +127,7 @@ class TestServerPlayback:
|
||||
|
||||
def test_headers(self):
|
||||
s = serverplayback.ServerPlayback()
|
||||
s.configure(options.Options(rheaders=["foo"]), [])
|
||||
s.configure(options.Options(server_replay_use_headers=["foo"]), [])
|
||||
|
||||
r = tutils.tflow(resp=True)
|
||||
r.request.headers["foo"] = "bar"
|
||||
|
Loading…
Reference in New Issue
Block a user