mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
options.nopop -> options.server_replay_nopop
This commit is contained in:
parent
5ebe8c1bc8
commit
8677e91074
@ -78,7 +78,7 @@ class ServerPlayback(object):
|
|||||||
"""
|
"""
|
||||||
hsh = self._hash(request)
|
hsh = self._hash(request)
|
||||||
if hsh in self.flowmap:
|
if hsh in self.flowmap:
|
||||||
if self.options.nopop:
|
if self.options.server_replay_nopop:
|
||||||
return self.flowmap[hsh][0]
|
return self.flowmap[hsh][0]
|
||||||
else:
|
else:
|
||||||
ret = self.flowmap[hsh].pop(0)
|
ret = self.flowmap[hsh].pop(0)
|
||||||
@ -101,8 +101,7 @@ class ServerPlayback(object):
|
|||||||
# prefixed with serverplayback_ where appropriate, and playback_ where
|
# prefixed with serverplayback_ where appropriate, and playback_ where
|
||||||
# they're shared with client playback.
|
# they're shared with client playback.
|
||||||
#
|
#
|
||||||
# options.server_replay_use_headers,
|
# options.server_replay_nopop,
|
||||||
# options.nopop,
|
|
||||||
# options.replay_ignore_params,
|
# options.replay_ignore_params,
|
||||||
# options.replay_ignore_content,
|
# options.replay_ignore_content,
|
||||||
# options.replay_ignore_payload_params,
|
# options.replay_ignore_payload_params,
|
||||||
|
@ -233,7 +233,7 @@ def get_common_options(args):
|
|||||||
showhost=args.showhost,
|
showhost=args.showhost,
|
||||||
outfile=args.outfile,
|
outfile=args.outfile,
|
||||||
verbosity=args.verbose,
|
verbosity=args.verbose,
|
||||||
nopop=args.nopop,
|
server_replay_nopop=args.server_replay_nopop,
|
||||||
replay_ignore_content=args.replay_ignore_content,
|
replay_ignore_content=args.replay_ignore_content,
|
||||||
replay_ignore_params=args.replay_ignore_params,
|
replay_ignore_params=args.replay_ignore_params,
|
||||||
replay_ignore_payload_params=args.replay_ignore_payload_params,
|
replay_ignore_payload_params=args.replay_ignore_payload_params,
|
||||||
@ -614,7 +614,7 @@ def server_replay(parser):
|
|||||||
)
|
)
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--no-pop",
|
"--no-pop",
|
||||||
action="store_true", dest="nopop", default=False,
|
action="store_true", dest="server_replay_nopop", default=False,
|
||||||
help="Disable response pop from response flow. "
|
help="Disable response pop from response flow. "
|
||||||
"This makes it possible to replay same response multiple times."
|
"This makes it possible to replay same response multiple times."
|
||||||
)
|
)
|
||||||
|
@ -149,7 +149,7 @@ class ConnectionItem(urwid.WidgetWrap):
|
|||||||
self.master.start_server_playback(
|
self.master.start_server_playback(
|
||||||
[i.copy() for i in self.master.state.view],
|
[i.copy() for i in self.master.state.view],
|
||||||
self.master.options.replay_kill_extra, self.master.options.server_replay_use_headers,
|
self.master.options.replay_kill_extra, self.master.options.server_replay_use_headers,
|
||||||
False, self.master.options.nopop,
|
False, self.master.options.server_replay_nopop,
|
||||||
self.master.options.replay_ignore_params,
|
self.master.options.replay_ignore_params,
|
||||||
self.master.options.replay_ignore_content,
|
self.master.options.replay_ignore_content,
|
||||||
self.master.options.replay_ignore_payload_params,
|
self.master.options.replay_ignore_payload_params,
|
||||||
@ -159,7 +159,7 @@ class ConnectionItem(urwid.WidgetWrap):
|
|||||||
self.master.start_server_playback(
|
self.master.start_server_playback(
|
||||||
[self.flow.copy()],
|
[self.flow.copy()],
|
||||||
self.master.options.replay_kill_extra, self.master.options.server_replay_use_headers,
|
self.master.options.replay_kill_extra, self.master.options.server_replay_use_headers,
|
||||||
False, self.master.options.nopop,
|
False, self.master.options.server_replay_nopop,
|
||||||
self.master.options.replay_ignore_params,
|
self.master.options.replay_ignore_params,
|
||||||
self.master.options.replay_ignore_content,
|
self.master.options.replay_ignore_content,
|
||||||
self.master.options.replay_ignore_payload_params,
|
self.master.options.replay_ignore_payload_params,
|
||||||
|
@ -33,7 +33,7 @@ class Options(optmanager.OptManager):
|
|||||||
replay_kill_extra=False, # type: bool
|
replay_kill_extra=False, # type: bool
|
||||||
keepserving=True, # type: bool
|
keepserving=True, # type: bool
|
||||||
no_server=False, # type: bool
|
no_server=False, # type: bool
|
||||||
nopop=False, # type: bool
|
server_replay_nopop=False, # type: bool
|
||||||
refresh_server_playback=False, # type: bool
|
refresh_server_playback=False, # type: bool
|
||||||
rfile=None, # type: Optional[str]
|
rfile=None, # type: Optional[str]
|
||||||
scripts=(), # type: Sequence[str]
|
scripts=(), # type: Sequence[str]
|
||||||
@ -91,7 +91,7 @@ class Options(optmanager.OptManager):
|
|||||||
self.keepserving = keepserving
|
self.keepserving = keepserving
|
||||||
self.replay_kill_extra = replay_kill_extra
|
self.replay_kill_extra = replay_kill_extra
|
||||||
self.no_server = no_server
|
self.no_server = no_server
|
||||||
self.nopop = nopop
|
self.server_replay_nopop = server_replay_nopop
|
||||||
self.refresh_server_playback = refresh_server_playback
|
self.refresh_server_playback = refresh_server_playback
|
||||||
self.rfile = rfile
|
self.rfile = rfile
|
||||||
self.scripts = scripts
|
self.scripts = scripts
|
||||||
|
@ -167,9 +167,9 @@ class TestServerPlayback:
|
|||||||
|
|
||||||
assert not s.next_flow(r)
|
assert not s.next_flow(r)
|
||||||
|
|
||||||
def test_load_with_nopop(self):
|
def test_load_with_server_replay_nopop(self):
|
||||||
s = serverplayback.ServerPlayback()
|
s = serverplayback.ServerPlayback()
|
||||||
s.configure(options.Options(nopop=True), [])
|
s.configure(options.Options(server_replay_nopop=True), [])
|
||||||
|
|
||||||
r = tutils.tflow(resp=True)
|
r = tutils.tflow(resp=True)
|
||||||
r.request.headers["key"] = "one"
|
r.request.headers["key"] = "one"
|
||||||
|
Loading…
Reference in New Issue
Block a user