summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-10 14:52:29 +0100
committerErik Johnston <erik@matrix.org>2019-10-10 14:52:29 +0100
commitca3e01e50d2caca6a55b7c7808f0e948b430363d (patch)
treea1ef9cad457b99fe52121b027588b5030c6fd508 /synapse/rest
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/disable_sq... (diff)
downloadsynapse-ca3e01e50d2caca6a55b7c7808f0e948b430363d.tar.xz
Fix store_url_cache using bytes
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/media/v1/preview_url_resource.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py
index 7a56cd4b6c..0c68c3aad5 100644
--- a/synapse/rest/media/v1/preview_url_resource.py
+++ b/synapse/rest/media/v1/preview_url_resource.py
@@ -270,7 +270,7 @@ class PreviewUrlResource(DirectServeResource):
 
         logger.debug("Calculated OG for %s as %s" % (url, og))
 
-        jsonog = json.dumps(og).encode("utf8")
+        jsonog = json.dumps(og)
 
         # store OG in history-aware DB cache
         yield self.store.store_url_cache(
@@ -283,7 +283,7 @@ class PreviewUrlResource(DirectServeResource):
             media_info["created_ts"],
         )
 
-        return jsonog
+        return jsonog.encode("utf8")
 
     @defer.inlineCallbacks
     def _download_url(self, url, user):