Merge pull request #1509 from arjun23496/regex_star_mod

Fixes #1471 - Change .* to match entire body
This commit is contained in:
Maximilian Hils 2016-09-21 18:13:14 -07:00 committed by GitHub
commit 1e5a5b03f8
2 changed files with 5 additions and 2 deletions

View File

@ -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:

View File

@ -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):