diff --git a/mitmproxy/builtins/serverplayback.py b/mitmproxy/builtins/serverplayback.py index 9156e1fe5..b13547f13 100644 --- a/mitmproxy/builtins/serverplayback.py +++ b/mitmproxy/builtins/serverplayback.py @@ -78,7 +78,7 @@ class ServerPlayback(object): """ hsh = self._hash(request) if hsh in self.flowmap: - if self.options.nopop: + if self.options.server_replay_nopop: return self.flowmap[hsh][0] else: ret = self.flowmap[hsh].pop(0) @@ -101,8 +101,7 @@ class ServerPlayback(object): # prefixed with serverplayback_ where appropriate, and playback_ where # they're shared with client playback. # - # options.server_replay_use_headers, - # options.nopop, + # options.server_replay_nopop, # options.replay_ignore_params, # options.replay_ignore_content, # options.replay_ignore_payload_params, diff --git a/mitmproxy/cmdline.py b/mitmproxy/cmdline.py index b3bde2b35..3419e9b64 100644 --- a/mitmproxy/cmdline.py +++ b/mitmproxy/cmdline.py @@ -233,7 +233,7 @@ def get_common_options(args): showhost=args.showhost, outfile=args.outfile, verbosity=args.verbose, - nopop=args.nopop, + server_replay_nopop=args.server_replay_nopop, replay_ignore_content=args.replay_ignore_content, replay_ignore_params=args.replay_ignore_params, replay_ignore_payload_params=args.replay_ignore_payload_params, @@ -614,7 +614,7 @@ def server_replay(parser): ) group.add_argument( "--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. " "This makes it possible to replay same response multiple times." ) diff --git a/mitmproxy/console/flowlist.py b/mitmproxy/console/flowlist.py index 970ffb925..fd3a41249 100644 --- a/mitmproxy/console/flowlist.py +++ b/mitmproxy/console/flowlist.py @@ -149,7 +149,7 @@ class ConnectionItem(urwid.WidgetWrap): self.master.start_server_playback( [i.copy() for i in self.master.state.view], 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_content, self.master.options.replay_ignore_payload_params, @@ -159,7 +159,7 @@ class ConnectionItem(urwid.WidgetWrap): self.master.start_server_playback( [self.flow.copy()], 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_content, self.master.options.replay_ignore_payload_params, diff --git a/mitmproxy/options.py b/mitmproxy/options.py index d11e99b6b..fd3df48ea 100644 --- a/mitmproxy/options.py +++ b/mitmproxy/options.py @@ -33,7 +33,7 @@ class Options(optmanager.OptManager): replay_kill_extra=False, # type: bool keepserving=True, # type: bool no_server=False, # type: bool - nopop=False, # type: bool + server_replay_nopop=False, # type: bool refresh_server_playback=False, # type: bool rfile=None, # type: Optional[str] scripts=(), # type: Sequence[str] @@ -91,7 +91,7 @@ class Options(optmanager.OptManager): self.keepserving = keepserving self.replay_kill_extra = replay_kill_extra self.no_server = no_server - self.nopop = nopop + self.server_replay_nopop = server_replay_nopop self.refresh_server_playback = refresh_server_playback self.rfile = rfile self.scripts = scripts diff --git a/test/mitmproxy/builtins/test_serverplayback.py b/test/mitmproxy/builtins/test_serverplayback.py index 4044d85d7..65366dbbc 100644 --- a/test/mitmproxy/builtins/test_serverplayback.py +++ b/test/mitmproxy/builtins/test_serverplayback.py @@ -167,9 +167,9 @@ class TestServerPlayback: assert not s.next_flow(r) - def test_load_with_nopop(self): + def test_load_with_server_replay_nopop(self): s = serverplayback.ServerPlayback() - s.configure(options.Options(nopop=True), []) + s.configure(options.Options(server_replay_nopop=True), []) r = tutils.tflow(resp=True) r.request.headers["key"] = "one"