aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-09-04 14:18:07 +0200
committerMaximilian Hils <git@maximilianhils.com>2014-09-04 14:18:07 +0200
commit1135666ee6fb145491eb6d07435eb0cf58b2094f (patch)
tree843fbfe8c708d8b260ea74fe7d98b3bad4bd1c6f /libmproxy/protocol
parent649e63ff3c868397f493e1dabdc1c63d572aedd8 (diff)
parent39fa579dd564823171f804c4307ab93db4d3b961 (diff)
downloadmitmproxy-1135666ee6fb145491eb6d07435eb0cf58b2094f.tar.gz
mitmproxy-1135666ee6fb145491eb6d07435eb0cf58b2094f.tar.bz2
mitmproxy-1135666ee6fb145491eb6d07435eb0cf58b2094f.zip
Merge branch 'master' into issue_341
Diffstat (limited to 'libmproxy/protocol')
-rw-r--r--libmproxy/protocol/http.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index 3f9eecb3..9699c78a 100644
--- a/libmproxy/protocol/http.py
+++ b/libmproxy/protocol/http.py
@@ -635,11 +635,12 @@ class HTTPResponse(HTTPMessage):
return f
def __repr__(self):
+ size = utils.pretty_size(len(self.content)) if self.content else "content missing"
return "<HTTPResponse: {code} {msg} ({contenttype}, {size})>".format(
code=self.code,
msg=self.msg,
- contenttype=self.headers.get_first("content-type", "?"),
- size=utils.pretty_size(len(self.content))
+ contenttype=self.headers.get_first("content-type", "unknown content type"),
+ size=size
)
@classmethod