summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-10-11 13:18:52 +0100
committerGitHub <noreply@github.com>2017-10-11 13:18:52 +0100
commitbc7f3eb32f99d77ac6d980313e80c85b2e310943 (patch)
treed5464721b2bb278509e8287d6dd1bac27c125df1 /synapse/handlers
parentMerge pull request #2490 from matrix-org/erikj/drop_left_room_events (diff)
parentUnfreeze event before serializing with ujson (diff)
downloadsynapse-bc7f3eb32f99d77ac6d980313e80c85b2e310943.tar.xz
Merge pull request #2483 from jeremycline/unfreeze-ujson-dump
Unfreeze event before serializing with ujson
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/message.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index ca8c6c55bb..eb7e052ba6 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -25,6 +25,7 @@ from synapse.types import (
 from synapse.util.async import run_on_reactor, ReadWriteLock, Limiter
 from synapse.util.logcontext import preserve_fn
 from synapse.util.metrics import measure_func
+from synapse.util.frozenutils import unfreeze
 from synapse.visibility import filter_events_for_client
 
 from ._base import BaseHandler
@@ -555,7 +556,7 @@ class MessageHandler(BaseHandler):
 
         # Ensure that we can round trip before trying to persist in db
         try:
-            dump = ujson.dumps(event.content)
+            dump = ujson.dumps(unfreeze(event.content))
             ujson.loads(dump)
         except:
             logger.exception("Failed to encode content: %r", event.content)