From e4079aa746e861c5d39f2812520e33c4d17d1007 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 14 Jul 2012 16:55:21 +1200 Subject: 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. --- test/test_filt.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') 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() -- cgit v1.2.3