Exemplo n.º 1
0
 def _response(self, cookie, host):
     s = flow.StickyCookieState(filt.parse(".*"))
     f = tutils.tflow_full()
     f.request.host = host
     f.response.headers["Set-Cookie"] = [cookie]
     s.handle_response(f)
     return s, f
Exemplo n.º 2
0
 def _response(self, cookie, host):
     s = flow.StickyCookieState(filt.parse(".*"))
     f = tutils.tflow_full()
     f.server_conn.address = tcp.Address((host, 80))
     f.response.headers["Set-Cookie"] = [cookie]
     s.handle_response(f)
     return s, f
Exemplo n.º 3
0
 def test_domain_match(self):
     s = flow.StickyCookieState(filt.parse(".*"))
     assert s.domain_match("www.google.com", ".google.com")
     assert s.domain_match("google.com", ".google.com")
Exemplo n.º 4
0
 def _response(self, cookie, host):
     s = flow.StickyCookieState(filt.parse(".*"))
     f = tutils.tflow(req=tutils.treq(host=host, port=80), resp=True)
     f.response.headers["Set-Cookie"] = [cookie]
     s.handle_response(f)
     return s, f