diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-11-12 10:59:57 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-11-12 11:58:04 +1300 |
commit | 00492919e7fe47c504e363fe9d5e461cf8f8967b (patch) | |
tree | 743b2652d6cb983b905b105af36d8dece0dd8092 /mitmproxy/http.py | |
parent | 5be35d258fd95f9f99ee6e8a32dc234f6b868385 (diff) | |
download | mitmproxy-00492919e7fe47c504e363fe9d5e461cf8f8967b.tar.gz mitmproxy-00492919e7fe47c504e363fe9d5e461cf8f8967b.tar.bz2 mitmproxy-00492919e7fe47c504e363fe9d5e461cf8f8967b.zip |
Add HTTPFlow.mode to record the HTTP proxy layer mode
Diffstat (limited to 'mitmproxy/http.py')
-rw-r--r-- | mitmproxy/http.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mitmproxy/http.py b/mitmproxy/http.py index 50174764..dafd4782 100644 --- a/mitmproxy/http.py +++ b/mitmproxy/http.py @@ -53,7 +53,7 @@ class HTTPRequest(http.Request): def get_state(self): state = super().get_state() state.update( - is_replay=self.is_replay, + is_replay=self.is_replay ) return state @@ -143,7 +143,7 @@ class HTTPFlow(flow.Flow): transaction. """ - def __init__(self, client_conn, server_conn, live=None): + def __init__(self, client_conn, server_conn, live=None, mode="regular"): super().__init__("http", client_conn, server_conn, live) self.request = None # type: HTTPRequest @@ -163,11 +163,14 @@ class HTTPFlow(flow.Flow): """:py:class:`ClientConnection` object """ self.intercepted = False # type: bool """ Is this flow currently being intercepted? """ + self.mode = mode + """ What mode was the proxy layer in when receiving this request? """ _stateobject_attributes = flow.Flow._stateobject_attributes.copy() _stateobject_attributes.update( request=HTTPRequest, - response=HTTPResponse + response=HTTPResponse, + mode=str ) def __repr__(self): |