summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorDavid Vo <auscompgeek@users.noreply.github.com>2020-08-07 22:02:55 +1000
committerGitHub <noreply@github.com>2020-08-07 08:02:55 -0400
commit4dd27e6d1125df83a754b5e0c2c14aaafc0ce837 (patch)
treedb0e46cd9c3f2f94cedb200d5599a4b4d61651de /synapse/rest
parentRevert #7736 (#8039) (diff)
downloadsynapse-4dd27e6d1125df83a754b5e0c2c14aaafc0ce837.tar.xz
Reduce unnecessary whitespace in JSON. (#7372)
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 f4768a9e8b..4bb454c36f 100644
--- a/synapse/rest/media/v1/preview_url_resource.py
+++ b/synapse/rest/media/v1/preview_url_resource.py
@@ -27,7 +27,6 @@ from typing import Dict, Optional
 from urllib import parse as urlparse
 
 import attr
-from canonicaljson import json
 
 from twisted.internet import defer
 from twisted.internet.error import DNSLookupError
@@ -43,6 +42,7 @@ from synapse.http.servlet import parse_integer, parse_string
 from synapse.logging.context import make_deferred_yieldable, run_in_background
 from synapse.metrics.background_process_metrics import run_as_background_process
 from synapse.rest.media.v1._base import get_filename_from_headers
+from synapse.util import json_encoder
 from synapse.util.async_helpers import ObservableDeferred
 from synapse.util.caches.expiringcache import ExpiringCache
 from synapse.util.stringutils import random_string
@@ -355,7 +355,7 @@ class PreviewUrlResource(DirectServeJsonResource):
 
         logger.debug("Calculated OG for %s as %s", url, og)
 
-        jsonog = json.dumps(og)
+        jsonog = json_encoder.encode(og)
 
         # store OG in history-aware DB cache
         await self.store.store_url_cache(