aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol2/http_protocol_mock.py
blob: 5fdb9f2b0f63720def800b529822ec978c2d4706 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
Temporary mock to sort out API discrepancies
"""
from netlib.http.http1 import HTTP1Protocol


class HTTP1(object):
    @staticmethod
    def read_request(connection, *args, **kwargs):
        """
        :type connection: object
        """
        return HTTP1Protocol(connection).read_request(*args, **kwargs)

    @staticmethod
    def read_response(connection, *args, **kwargs):
        """
        :type connection: object
        """
        return HTTP1Protocol(connection).read_response(*args, **kwargs)

    @staticmethod
    def read_http_body(connection, *args, **kwargs):
        """
        :type connection: object
        """
        return HTTP1Protocol(connection).read_http_body(*args, **kwargs)


    @staticmethod
    def _assemble_response_first_line(connection, *args, **kwargs):
        """
        :type connection: object
        """
        return HTTP1Protocol(connection)._assemble_response_first_line(*args, **kwargs)


    @staticmethod
    def _assemble_response_headers(connection, *args, **kwargs):
        """
        :type connection: object
        """
        return HTTP1Protocol(connection)._assemble_response_headers(*args, **kwargs)


    @staticmethod
    def read_http_body_chunked(connection, *args, **kwargs):
        """
        :type connection: object
        """
        return HTTP1Protocol(connection).read_http_body_chunked(*args, **kwargs)