diff --git a/mitmproxy/addons/modifyheaders.py b/mitmproxy/addons/modifyheaders.py index 2e6eb8f60..d560f5986 100644 --- a/mitmproxy/addons/modifyheaders.py +++ b/mitmproxy/addons/modifyheaders.py @@ -53,7 +53,7 @@ def parse_modify_spec(option) -> ModifySpec: elif len(parts) == 3: flow_filter_pattern, subject, replacement = parts else: - raise ValueError(f"Invalid number of parameters (2 or 3 are expected)") + raise ValueError("Invalid number of parameters (2 or 3 are expected)") flow_filter = flowfilter.parse(flow_filter_pattern) if not flow_filter: diff --git a/test/mitmproxy/utils/test_arg_check.py b/test/mitmproxy/utils/test_arg_check.py index 8ab140770..2c3c0d221 100644 --- a/test/mitmproxy/utils/test_arg_check.py +++ b/test/mitmproxy/utils/test_arg_check.py @@ -24,8 +24,9 @@ from mitmproxy.utils import arg_check 'SPEC Format: "username:pass", "any" to accept any user/pass combination,\n' '"@path" to use an Apache htpasswd file, or\n' '"ldap[s]:url_server_ldap:dn_auth:password:dn_subtree" ' - 'for LDAP authentication.') - + 'for LDAP authentication.'), + (["--replacements"], "--replacements is deprecated.\n" + "Please use `--modify-body` or `--modify-headers` instead."), ]) def test_check_args(arg, output): f = io.StringIO()