aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-07-14 16:55:21 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-07-14 16:55:21 +1200
commite4079aa746e861c5d39f2812520e33c4d17d1007 (patch)
treea55e399207d470aec4cc61c77fc2c842adc9ed59 /test
parent150814f6a88cc26af1e812d41370dabd78092c33 (diff)
downloadmitmproxy-e4079aa746e861c5d39f2812520e33c4d17d1007.tar.gz
mitmproxy-e4079aa746e861c5d39f2812520e33c4d17d1007.tar.bz2
mitmproxy-e4079aa746e861c5d39f2812520e33c4d17d1007.zip
Add an ~a filter expression, matching an asset content type in responses.
Asset content types are Javascript, images, Flash and CSS. This is useful because doing a quick "!~a" while auditing an app will filter out the majority of the static asset cruft, letting you focus on what matters.
Diffstat (limited to 'test')
-rw-r--r--test/test_filt.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_filt.py b/test/test_filt.py
index 1cea34c4..4e059196 100644
--- a/test/test_filt.py
+++ b/test/test_filt.py
@@ -112,6 +112,12 @@ class TestMatching:
def q(self, q, o):
return filt.parse(q)(o)
+ def test_asset(self):
+ s = self.resp()
+ assert not self.q("~a", s)
+ s.response.headers["content-type"] = ["text/javascript"]
+ assert self.q("~a", s)
+
def test_fcontenttype(self):
q = self.req()
s = self.resp()