diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-09-21 18:13:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-21 18:13:14 -0700 |
commit | 1e5a5b03f8d56df62a04a368bd5eb2d59cb7582a (patch) | |
tree | 4062cfdaf55d321027af3dbb7142afd701fe80da | |
parent | 7d4ce1da98e860fb06117c427dc04b654f76a914 (diff) | |
parent | 2e1265f75ebfc59eac38d6cfa4839d8d10165ace (diff) | |
download | mitmproxy-1e5a5b03f8d56df62a04a368bd5eb2d59cb7582a.tar.gz mitmproxy-1e5a5b03f8d56df62a04a368bd5eb2d59cb7582a.tar.bz2 mitmproxy-1e5a5b03f8d56df62a04a368bd5eb2d59cb7582a.zip |
Merge pull request #1509 from arjun23496/regex_star_mod
Fixes #1471 - Change .* to match entire body
-rw-r--r-- | mitmproxy/builtins/replace.py | 4 | ||||
-rw-r--r-- | mitmproxy/filt.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/mitmproxy/builtins/replace.py b/mitmproxy/builtins/replace.py index c938d683..df3cab04 100644 --- a/mitmproxy/builtins/replace.py +++ b/mitmproxy/builtins/replace.py @@ -36,9 +36,9 @@ class Replace: for rex, s, cpatt in self.lst: if cpatt(f): if f.response: - f.response.replace(rex, s) + f.response.replace(rex, s, flags=re.DOTALL) else: - f.request.replace(rex, s) + f.request.replace(rex, s, flags=re.DOTALL) def request(self, flow): if not flow.reply.has_message: diff --git a/mitmproxy/filt.py b/mitmproxy/filt.py index 67915e5b..eb3e392b 100644 --- a/mitmproxy/filt.py +++ b/mitmproxy/filt.py @@ -244,6 +244,7 @@ class FHeadResponse(_Rex): class FBod(_Rex): code = "b" help = "Body" + flags = re.DOTALL @only(HTTPFlow, TCPFlow) def __call__(self, f): @@ -264,6 +265,7 @@ class FBod(_Rex): class FBodRequest(_Rex): code = "bq" help = "Request body" + flags = re.DOTALL @only(HTTPFlow, TCPFlow) def __call__(self, f): @@ -280,6 +282,7 @@ class FBodRequest(_Rex): class FBodResponse(_Rex): code = "bs" help = "Response body" + flags = re.DOTALL @only(HTTPFlow, TCPFlow) def __call__(self, f): |