diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-05-18 22:51:13 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-05-18 22:51:13 -0700 |
commit | f4c3c012661139687eb6151e8d364263c903d8a9 (patch) | |
tree | d60fa240765bcfe5946507260b9f39e42c03b679 /mitmproxy | |
parent | 4c3fb8f5097fad2c5de96104dae3f8026b0b4666 (diff) | |
download | mitmproxy-f4c3c012661139687eb6151e8d364263c903d8a9.tar.gz mitmproxy-f4c3c012661139687eb6151e8d364263c903d8a9.tar.bz2 mitmproxy-f4c3c012661139687eb6151e8d364263c903d8a9.zip |
display response reason in ui
Diffstat (limited to 'mitmproxy')
-rw-r--r-- | mitmproxy/console/common.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mitmproxy/console/common.py b/mitmproxy/console/common.py index 4e472fb6..25658dfa 100644 --- a/mitmproxy/console/common.py +++ b/mitmproxy/console/common.py @@ -154,7 +154,7 @@ def raw_format_flow(f, focus, extended): if f["intercepted"] and not f["acked"]: uc = "intercept" - elif f["resp_code"] or f["err_msg"]: + elif "resp_code" in f or "err_msg" in f: uc = "text" else: uc = "title" @@ -173,7 +173,7 @@ def raw_format_flow(f, focus, extended): ("fixed", preamble, urwid.Text("")) ) - if f["resp_code"]: + if "resp_code" in f: codes = { 2: "code_200", 3: "code_300", @@ -185,6 +185,8 @@ def raw_format_flow(f, focus, extended): if f["resp_is_replay"]: resp.append(fcol(SYMBOL_REPLAY, "replay")) resp.append(fcol(f["resp_code"], ccol)) + if extended: + resp.append(fcol(f["resp_reason"], ccol)) if f["intercepted"] and f["resp_code"] and not f["acked"]: rc = "intercept" else: @@ -412,7 +414,6 @@ def format_flow(f, focus, extended=False, hostheader=False, marked=False): req_http_version = f.request.http_version, err_msg = f.error.msg if f.error else None, - resp_code = f.response.status_code if f.response else None, marked = marked, ) @@ -430,6 +431,7 @@ def format_flow(f, focus, extended=False, hostheader=False, marked=False): d.update(dict( resp_code = f.response.status_code, + resp_reason = f.response.reason, resp_is_replay = f.response.is_replay, resp_clen = contentdesc, roundtrip = roundtrip, |