From 4781c565a97b37d3401f87cd40b1d2c0fccba9ce Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 4 Sep 2014 12:29:44 +0200 Subject: [PATCH] fix #344 --- libmproxy/protocol/http.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index efeed008b..1da9caa6f 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -638,11 +638,12 @@ class HTTPResponse(HTTPMessage): return f def __repr__(self): + size = utils.pretty_size(len(self.content)) if self.content else "content missing" return "".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