diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-03-09 13:15:31 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-03-09 13:15:31 +1300 |
commit | 03f13453856e3af15dc3af81adcf3a80d1358da0 (patch) | |
tree | f4700518429e2264ee083034f2b91aa7425ce5e8 /test | |
parent | 592812467da5bfe8196f16dcfa6d348551c4febd (diff) | |
download | mitmproxy-03f13453856e3af15dc3af81adcf3a80d1358da0.tar.gz mitmproxy-03f13453856e3af15dc3af81adcf3a80d1358da0.tar.bz2 mitmproxy-03f13453856e3af15dc3af81adcf3a80d1358da0.zip |
Add an --anticache option to mitmdump.
This removes all headers that might cause a server to return 304-not-modified.
For now, all the new features are going into mitmdump - everything will be
ported over to mitmproxy once I have the feature set locked down.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_flow.py | 3 | ||||
-rw-r--r-- | test/test_proxy.py | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/test/test_flow.py b/test/test_flow.py index 4090d483..d72a1894 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -167,8 +167,6 @@ class uFlow(libpry.AutoTree): f.load_state(f2.get_state()) assert f == f2 - - def test_kill(self): f = tutils.tflow() f.request = tutils.treq() @@ -370,6 +368,7 @@ class uFlowMaster(libpry.AutoTree): def test_all(self): s = flow.State() fm = flow.FlowMaster(None, s) + fm.anticache = True req = tutils.treq() fm.handle_clientconnect(req.client_conn) diff --git a/test/test_proxy.py b/test/test_proxy.py index e5b3ed16..3bc5bcdb 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -78,6 +78,15 @@ class uRequest(libpry.AutoTree): assert r.url() == u assert r.assemble() + def test_anticache(self): + h = utils.Headers() + r = proxy.Request(None, "host", 22, "https", "GET", "/", h, "content") + h["if-modified-since"] = ["test"] + h["if-none-match"] = ["test"] + r.anticache() + assert not "if-modified-since" in r.headers + assert not "if-none-match" in r.headers + def test_getset_state(self): h = utils.Headers() h["test"] = ["test"] |