diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2017-01-14 13:11:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-14 13:11:26 +0100 |
commit | 78fe04ca9df104802de5512755498a3caa7c4d71 (patch) | |
tree | 1e1e7b2e93abb29ff2d0b733190776c888796b2c | |
parent | 028a98380d602b8b5e018039d302fdb735471c19 (diff) | |
parent | fe43e629fd0179a19fc63eebe482890dd679db3b (diff) | |
download | mitmproxy-78fe04ca9df104802de5512755498a3caa7c4d71.tar.gz mitmproxy-78fe04ca9df104802de5512755498a3caa7c4d71.tar.bz2 mitmproxy-78fe04ca9df104802de5512755498a3caa7c4d71.zip |
Merge pull request #1923 from mhils/display-http-version
console: display http version in details
-rw-r--r-- | mitmproxy/tools/console/flowdetailview.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mitmproxy/tools/console/flowdetailview.py b/mitmproxy/tools/console/flowdetailview.py index 571a5e1b..d713787a 100644 --- a/mitmproxy/tools/console/flowdetailview.py +++ b/mitmproxy/tools/console/flowdetailview.py @@ -1,5 +1,6 @@ import urwid +from mitmproxy import http from mitmproxy.tools.console import common, searchable from mitmproxy.utils import human from mitmproxy.utils import strutils @@ -12,7 +13,7 @@ def maybe_timestamp(base, attr): return "active" -def flowdetails(state, flow): +def flowdetails(state, flow: http.HTTPFlow): text = [] sc = flow.server_conn @@ -21,7 +22,7 @@ def flowdetails(state, flow): resp = flow.response metadata = flow.metadata - if metadata is not None and len(metadata.items()) > 0: + if metadata is not None and len(metadata) > 0: parts = [[str(k), repr(v)] for k, v in metadata.items()] text.append(urwid.Text([("head", "Metadata:")])) text.extend(common.format_keyvals(parts, key="key", val="text", indent=4)) @@ -32,6 +33,8 @@ def flowdetails(state, flow): ["Address", repr(sc.address)], ["Resolved Address", repr(sc.ip_address)], ] + if resp: + parts.append(["HTTP Version", resp.http_version]) if sc.alpn_proto_negotiated: parts.append(["ALPN", sc.alpn_proto_negotiated]) @@ -91,6 +94,8 @@ def flowdetails(state, flow): parts = [ ["Address", repr(cc.address)], ] + if req: + parts.append(["HTTP Version", req.http_version]) if cc.tls_version: parts.append(["TLS Version", cc.tls_version]) if cc.sni: |