aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2017-04-22 10:33:07 +0200
committerGitHub <noreply@github.com>2017-04-22 10:33:07 +0200
commit90c425bd14087a984afd92eec2c18e63707e4ffa (patch)
tree221d1321a4af77e465ef3e317f199e56e7b7ef90
parent6af72160bf98b58682b8f9fc5aabf51928d2b1d3 (diff)
parent73692b909b6723a2fb25b4ef38e343c0cf0b57f3 (diff)
downloadmitmproxy-90c425bd14087a984afd92eec2c18e63707e4ffa.tar.gz
mitmproxy-90c425bd14087a984afd92eec2c18e63707e4ffa.tar.bz2
mitmproxy-90c425bd14087a984afd92eec2c18e63707e4ffa.zip
Merge pull request #2256 from ujjwal96/ip-formatting
Fixed formatting in mitmdump
-rw-r--r--mitmproxy/addons/dumper.py2
-rw-r--r--mitmproxy/tools/console/flowdetailview.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/mitmproxy/addons/dumper.py b/mitmproxy/addons/dumper.py
index ca0d32d3..5fd8408f 100644
--- a/mitmproxy/addons/dumper.py
+++ b/mitmproxy/addons/dumper.py
@@ -102,7 +102,7 @@ class Dumper:
if flow.client_conn:
client = click.style(
strutils.escape_control_characters(
- repr(flow.client_conn.address)
+ human.format_address(flow.client_conn.address)
)
)
elif flow.request.is_replay:
diff --git a/mitmproxy/tools/console/flowdetailview.py b/mitmproxy/tools/console/flowdetailview.py
index 30eaea90..9ed063bc 100644
--- a/mitmproxy/tools/console/flowdetailview.py
+++ b/mitmproxy/tools/console/flowdetailview.py
@@ -30,9 +30,10 @@ def flowdetails(state, flow: http.HTTPFlow):
if sc is not None:
text.append(urwid.Text([("head", "Server Connection:")]))
parts = [
- ["Address", "{}".format(human.format_address(sc.address))],
- ["Resolved Address", "{}".format(human.format_address(sc.ip_address))],
+ ["Address", human.format_address(sc.address)],
]
+ if sc.ip_address:
+ parts.append(["Resolved Address", human.format_address(sc.ip_address)])
if resp:
parts.append(["HTTP Version", resp.http_version])
if sc.alpn_proto_negotiated: