From c33df9dd1c360cfc8d675caa7627d3de1f3179a9 Mon Sep 17 00:00:00 2001 From: isra17 Date: Mon, 13 Jul 2015 18:08:36 -0400 Subject: [PATCH] Use `ensure_ascii` in wep.app#broadcast Otherwise, a non-unicode character in a flow cause mitmweb to crash. --- libmproxy/web/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmproxy/web/app.py b/libmproxy/web/app.py index 29ae9e7a8..d6082ee24 100644 --- a/libmproxy/web/app.py +++ b/libmproxy/web/app.py @@ -81,7 +81,8 @@ class WebSocketEventBroadcaster(tornado.websocket.WebSocketHandler): @classmethod def broadcast(cls, **kwargs): - message = json.dumps(kwargs) + message = json.dumps(kwargs, ensure_ascii=False) + for conn in cls.connections: try: conn.write_message(message)