diff options
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/console/__init__.py | 2 | ||||
-rw-r--r-- | libmproxy/protocol/http.py | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index a5920915..ca395ed9 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -599,6 +599,8 @@ class ConsoleMaster(flow.FlowMaster): try: self.ui.run_wrapper(self.loop) except Exception: + self.ui.stop() + sys.stdout.flush() print >> sys.stderr, traceback.format_exc() print >> sys.stderr, "mitmproxy has crashed!" print >> sys.stderr, "Please lodge a bug report at: https://github.com/mitmproxy/mitmproxy" diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 90d8ff16..253192dd 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -605,11 +605,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 |