コード例 #1
0
def default_addons():
    return [
        anticache.AntiCache(),
        anticomp.AntiComp(),
        stickyauth.StickyAuth(),
        stickycookie.StickyCookie(),
        script.ScriptLoader(),
        filestreamer.FileStreamer(),
        replace.Replace(),
        setheaders.SetHeaders(),
    ]
コード例 #2
0
def default_addons():
    return [
        anticache.AntiCache(),
        anticomp.AntiComp(),
        stickyauth.StickyAuth(),
        stickycookie.StickyCookie(),
        script.ScriptLoader(),
        filestreamer.FileStreamer(),
        # replace.Replace(),
        setheaders.SetHeaders(),
        serverplayback.ServerPlayback(),
        clientplayback.ClientPlayback(),
    ]
コード例 #3
0
    def test_simple(self):
        o = options.Options(anticache=True)
        m = master.Master(o, proxy.DummyServer())
        sa = anticache.AntiCache()
        m.addons.add(sa)

        f = tutils.tflow(resp=True)
        m.request(f)

        f = tutils.tflow(resp=True)
        f.request.headers["if-modified-since"] = "test"
        f.request.headers["if-none-match"] = "test"
        m.request(f)
        assert "if-modified-since" not in f.request.headers
        assert "if-none-match" not in f.request.headers
コード例 #4
0
    def test_simple(self):
        s = state.State()
        o = options.Options(anticache = True)
        m = master.FlowMaster(o, None, s)
        sa = anticache.AntiCache()
        m.addons.add(o, 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