diff options
Diffstat (limited to 'mitmproxy/filt.py')
-rw-r--r-- | mitmproxy/filt.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/mitmproxy/filt.py b/mitmproxy/filt.py index b1b72aa7..cb49283d 100644 --- a/mitmproxy/filt.py +++ b/mitmproxy/filt.py @@ -193,12 +193,22 @@ class FBod(_Rex): help = "Body" def __call__(self, f): - if f.request and f.request.content: - if self.re.search(f.request.get_decoded_content()): - return True - if f.response and f.response.content: - if self.re.search(f.response.get_decoded_content()): - return True + + # HTTPFlow + if hasattr(f, 'request'): + if f.request and f.request.content: + if self.re.search(f.request.get_decoded_content()): + return True + if f.response and f.response.content: + if self.re.search(f.response.get_decoded_content()): + return True + + # TCPFlow + elif hasattr(f, 'messages'): + for msg in f.messages: + if self.re.search(msg.content): + return True + return False |