aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-08-03 02:34:29 +0200
committerMaximilian Hils <git@maximilianhils.com>2014-08-03 02:34:29 +0200
commit3133136da763107172b1464b777362b7b7f8e54e (patch)
tree4c500fcae39b4922679fe6bc10a4f81ab788eeae /test
parent10a6d4fbe5a910b75813edc1bf8f22eec3b8bf3c (diff)
downloadmitmproxy-3133136da763107172b1464b777362b7b7f8e54e.tar.gz
mitmproxy-3133136da763107172b1464b777362b7b7f8e54e.tar.bz2
mitmproxy-3133136da763107172b1464b777362b7b7f8e54e.zip
fix #307
Diffstat (limited to 'test')
-rw-r--r--test/test_filt.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/test_filt.py b/test/test_filt.py
index 452a4505..279f550f 100644
--- a/test/test_filt.py
+++ b/test/test_filt.py
@@ -171,9 +171,7 @@ class TestMatching:
assert self.q("~hs 'header_response: svalue'", s)
assert not self.q("~hs 'header: qvalue'", q)
- def test_body(self):
- q = self.req()
- s = self.resp()
+ def match_body(self, q, s):
assert not self.q("~b nonexistent", q)
assert self.q("~b content", q)
assert self.q("~b response", s)
@@ -190,6 +188,16 @@ class TestMatching:
assert not self.q("~bs response", q)
assert self.q("~bs response", s)
+ def test_body(self):
+ q = self.req()
+ s = self.resp()
+ self.match_body(q, s)
+
+ q.request.encode("gzip")
+ s.request.encode("gzip")
+ s.response.encode("gzip")
+ self.match_body(q, s)
+
def test_method(self):
q = self.req()
s = self.resp()