aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUjjwal Verma <ujjwalverma1111@gmail.com>2017-03-09 23:33:11 +0530
committerUjjwal Verma <ujjwalverma1111@gmail.com>2017-03-09 23:33:11 +0530
commit25703f8c539fb954efb2551f6f5050018d623501 (patch)
tree182e1ee13906ddf8a4ccd2d46e56bc70ede95def
parent07a8c4987a5281e1220204f6e425afe559d52383 (diff)
downloadmitmproxy-25703f8c539fb954efb2551f6f5050018d623501.tar.gz
mitmproxy-25703f8c539fb954efb2551f6f5050018d623501.tar.bz2
mitmproxy-25703f8c539fb954efb2551f6f5050018d623501.zip
Fixed Replacement test
-rw-r--r--mitmproxy/addons/replace.py1
-rw-r--r--mitmproxy/options.py1
-rw-r--r--test/mitmproxy/addons/test_replace.py10
3 files changed, 6 insertions, 6 deletions
diff --git a/mitmproxy/addons/replace.py b/mitmproxy/addons/replace.py
index a653bd70..012c42bd 100644
--- a/mitmproxy/addons/replace.py
+++ b/mitmproxy/addons/replace.py
@@ -59,6 +59,7 @@ class _ReplaceBase:
lst = []
for rep in getattr(options, self.optionName):
fpatt, rex, s = parse_hook(rep)
+
flt = flowfilter.parse(fpatt)
if not flt:
raise exceptions.OptionsError(
diff --git a/mitmproxy/options.py b/mitmproxy/options.py
index 462752c4..088d52c2 100644
--- a/mitmproxy/options.py
+++ b/mitmproxy/options.py
@@ -120,7 +120,6 @@ class Options(optmanager.OptManager):
the separator can be any character.
"""
)
-
self.add_option(
"server_replay_use_headers", Sequence[str], [],
"Request headers to be considered during replay."
diff --git a/test/mitmproxy/addons/test_replace.py b/test/mitmproxy/addons/test_replace.py
index 8c280c51..79ef7bac 100644
--- a/test/mitmproxy/addons/test_replace.py
+++ b/test/mitmproxy/addons/test_replace.py
@@ -72,7 +72,7 @@ class TestUpstreamProxy(tservers.HTTPUpstreamProxyTest):
class TestReplaceFile:
def test_simple(self):
- r = replace.ReplaceFile()
+ r = replace.Replace()
with tutils.tmpdir() as td:
rp = os.path.join(td, "replacement")
with open(rp, "w") as f:
@@ -80,10 +80,10 @@ class TestReplaceFile:
with taddons.context() as tctx:
tctx.configure(
r,
- replacement_files = [
- "/~q/foo/" + rp,
- "/~s/foo/" + rp,
- "/~b nonexistent/nonexistent/nonexistent",
+ replacements = [
+ "/~q/foo/@" + rp,
+ "/~s/foo/@" + rp,
+ "/~b nonexistent/nonexistent/@nonexistent",
]
)
f = tflow.tflow()