diff --git a/mitmproxy/builtins/serverplayback.py b/mitmproxy/builtins/serverplayback.py index 1cbb9e15c..9156e1fe5 100644 --- a/mitmproxy/builtins/serverplayback.py +++ b/mitmproxy/builtins/serverplayback.py @@ -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, diff --git a/mitmproxy/cmdline.py b/mitmproxy/cmdline.py index 2c29344fa..b3bde2b35 100644 --- a/mitmproxy/cmdline.py +++ b/mitmproxy/cmdline.py @@ -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." ) diff --git a/mitmproxy/console/flowlist.py b/mitmproxy/console/flowlist.py index 1358495d2..970ffb925 100644 --- a/mitmproxy/console/flowlist.py +++ b/mitmproxy/console/flowlist.py @@ -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, diff --git a/mitmproxy/options.py b/mitmproxy/options.py index 3a1831936..d11e99b6b 100644 --- a/mitmproxy/options.py +++ b/mitmproxy/options.py @@ -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 diff --git a/test/mitmproxy/builtins/test_serverplayback.py b/test/mitmproxy/builtins/test_serverplayback.py index 58c788fd3..4044d85d7 100644 --- a/test/mitmproxy/builtins/test_serverplayback.py +++ b/test/mitmproxy/builtins/test_serverplayback.py @@ -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"