Esempio n. 1
0
 def make_chains(self, empty=True):
     chain = None
     if empty:
         chain = deproxy.MessageChain.empty()
     else:
         chain = functional.base_message_chain()
     return [chain for i in range(self.requests_n)]
Esempio n. 2
0
    def make_chains(self, uri, extra_header=(None, None)):
        chain = functional.base_message_chain(uri=uri)

        header, value = extra_header
        if not header is None:
            for req in [chain.request, chain.fwd_request]:
                req.headers.delete_all(header)
                req.headers.add(header, value)
                req.update()

        return [chain for i in range(self.requests_n)]
Esempio n. 3
0
def proxy_chain(method, uri):
    chain = functional.base_message_chain(uri=uri, method=method)
    if method == 'HEAD':
        remove_body(chain.response)
        remove_body(chain.server_response)
    return chain
Esempio n. 4
0
def cache_chain(method, uri):
    chain = functional.base_message_chain(uri=uri, method=method)
    chain.no_forward()
    if method == 'HEAD':
        remove_body(chain.response)
    return chain
Esempio n. 5
0
def proxy_chain(uri):
    return functional.base_message_chain(uri=uri)
Esempio n. 6
0
def cache_chain(uri):
    cached_chain = functional.base_message_chain(uri=uri)
    cached_chain.no_forward()
    return cached_chain
Esempio n. 7
0
def sample_rule():
    return functional.base_message_chain()
Esempio n. 8
0
 def chains(self):
     chain = functional.base_message_chain()
     return [chain for i in range (self.messages)]
Esempio n. 9
0
 def __init__(self, *args, **kwargs):
     deproxy.Deproxy.__init__(self, *args, **kwargs)
     # The first message chain is unique.
     self.message_chains = [functional.base_message_chain()] + chains()
     self.cookie_parsed = False
Esempio n. 10
0
def chains():
    chain = functional.base_message_chain()
    return [chain for i in range(CHAIN_LENGTH)]