blob: 5a00af03d71eca0942f45e457464f92d1bd9dbed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
from .. import tutils, mastertest
from mitmproxy.builtins import anticache
from mitmproxy.flow import master
from mitmproxy.flow import state
from mitmproxy import options
class TestAntiCache(mastertest.MasterTest):
def test_simple(self):
s = state.State()
m = master.FlowMaster(options.Options(anticache = True), None, s)
sa = anticache.AntiCache()
m.addons.add(sa)
f = tutils.tflow(resp=True)
self.invoke(m, "request", f)
f = tutils.tflow(resp=True)
f.request.headers["if-modified-since"] = "test"
f.request.headers["if-none-match"] = "test"
self.invoke(m, "request", f)
assert "if-modified-since" not in f.request.headers
assert "if-none-match" not in f.request.headers
|