aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mitmproxy/builtins/replace.py4
-rw-r--r--mitmproxy/filt.py3
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):