diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-04-08 01:22:23 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-04-08 01:22:23 +0200 |
commit | 1a666bb5db83e1a5c1d82bddc5d59bb700a1502f (patch) | |
tree | d54aecaf5ab8c3b5761eafbb2c89241a32564f25 /test | |
parent | f2ad047966e227a7d12c2d6381c7af7b64415611 (diff) | |
parent | 6a24a4e3c5f6011c23a8408e83912cbd9a815664 (diff) | |
download | mitmproxy-1a666bb5db83e1a5c1d82bddc5d59bb700a1502f.tar.gz mitmproxy-1a666bb5db83e1a5c1d82bddc5d59bb700a1502f.tar.bz2 mitmproxy-1a666bb5db83e1a5c1d82bddc5d59bb700a1502f.zip |
Merge pull request #547 from macmantrl/blank_values
Keep blank query values for flow hashing
Diffstat (limited to 'test')
-rw-r--r-- | test/test_flow.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/test_flow.py b/test/test_flow.py index b41eb630..b0b0ee5c 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -125,6 +125,10 @@ class TestServerPlaybackState: r.request.path = "voing" assert s._hash(r) != s._hash(r2) + r.request.path = "path?blank_value" + r2.request.path = "path?" + assert s._hash(r) != s._hash(r2) + def test_headers(self): s = flow.ServerPlaybackState(["foo"], [], False, False, None, False, None, False) r = tutils.tflow(resp=True) @@ -197,12 +201,12 @@ class TestServerPlaybackState: r2 = tutils.tflow(resp=True) r2.request.headers["Content-Type"] = ["application/x-www-form-urlencoded"] r2.request.content = "paramx=x¶m1=1" - # same parameters + # same parameters assert s._hash(r) == s._hash(r2) - # ignored parameters != + # ignored parameters != r2.request.content = "paramx=x¶m1=2" assert s._hash(r) == s._hash(r2) - # missing parameter + # missing parameter r2.request.content="paramx=x" assert s._hash(r) == s._hash(r2) # ignorable parameter added @@ -223,7 +227,7 @@ class TestServerPlaybackState: r2 = tutils.tflow(resp=True) r2.request.headers["Content-Type"] = ["application/json"] r2.request.content = '{"param1":"1"}' - # same content + # same content assert s._hash(r) == s._hash(r2) # distint content (note only x-www-form-urlencoded payload is analysed) r2.request.content = '{"param1":"2"}' @@ -238,7 +242,7 @@ class TestServerPlaybackState: r2 = tutils.tflow(resp=True) r2.request.headers["Content-Type"] = ["application/x-www-form-urlencoded"] r2.request.content = "paramx=x" - # same parameters + # same parameters assert s._hash(r) == s._hash(r2) def test_ignore_content(self): |