diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-07-29 11:39:53 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-07-30 13:53:17 +0200 |
commit | a5d9e1f44dbe0fc6fee174b1953806f9b148b5ad (patch) | |
tree | 0ee53b14c3513472ea1597144b228841454eef4f /libmproxy/console/common.py | |
parent | 89f22f735944989912a7a0394dd7e80d420cb0f3 (diff) | |
download | mitmproxy-a5d9e1f44dbe0fc6fee174b1953806f9b148b5ad.tar.gz mitmproxy-a5d9e1f44dbe0fc6fee174b1953806f9b148b5ad.tar.bz2 mitmproxy-a5d9e1f44dbe0fc6fee174b1953806f9b148b5ad.zip |
move code to netlib and implement protocols
Diffstat (limited to 'libmproxy/console/common.py')
-rw-r--r-- | libmproxy/console/common.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py index 90bccfe7..5ce2c0b7 100644 --- a/libmproxy/console/common.py +++ b/libmproxy/console/common.py @@ -4,10 +4,13 @@ import urwid import urwid.util import os +from netlib.http.semantics import CONTENT_MISSING +import netlib.utils + from .. import utils -from ..protocol.http import CONTENT_MISSING, decoded +from ..protocol.http import decoded from . import signals -import netlib.utils + try: import pyperclip @@ -135,7 +138,7 @@ def raw_format_flow(f, focus, extended, padding): ) else: req.append(fcol(">>" if focus else " ", "focus")) - + if f["marked"]: req.append(fcol(SYMBOL_MARK, "mark")) @@ -249,7 +252,7 @@ def copy_flow_format_data(part, scope, flow): return None, "Request content is missing" with decoded(flow.request): if part == "h": - data += flow.request.assemble() + data += flow.client_protocol.assemble(flow.request) elif part == "c": data += flow.request.content else: @@ -262,7 +265,7 @@ def copy_flow_format_data(part, scope, flow): return None, "Response content is missing" with decoded(flow.response): if part == "h": - data += flow.response.assemble() + data += flow.client_protocol.assemble(flow.response) elif part == "c": data += flow.response.content else: @@ -295,7 +298,7 @@ def copy_flow(part, scope, flow, master, state): toclip = "" try: toclip = data.decode('utf-8') - except (UnicodeDecodeError): + except (UnicodeDecodeError): toclip = data try: @@ -391,7 +394,7 @@ def format_flow(f, focus, extended=False, hostheader=False, padding=2, err_msg = f.error.msg if f.error else None, resp_code = f.response.code if f.response else None, - + marked = marked, ) if f.response: |