diff options
author | Matthew Hodgson <matthew@matrix.org> | 2016-04-02 03:06:39 +0100 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2016-04-02 03:06:39 +0100 |
commit | d1b154a10fc0f71fb36010f784ca6570f845c8d5 (patch) | |
tree | 7c92377a4bd98883200bea1150bb63bab50ec910 /synapse/rest/media/v1/preview_url_resource.py | |
parent | how was _respond_default_thumbnail ever meant to work? (diff) | |
download | synapse-d1b154a10fc0f71fb36010f784ca6570f845c8d5.tar.xz |
support gzip compression, and don't pass through error msgs
Diffstat (limited to 'synapse/rest/media/v1/preview_url_resource.py')
-rw-r--r-- | synapse/rest/media/v1/preview_url_resource.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py index 3ffdafce09..162e09ba71 100644 --- a/synapse/rest/media/v1/preview_url_resource.py +++ b/synapse/rest/media/v1/preview_url_resource.py @@ -200,7 +200,7 @@ class PreviewUrlResource(BaseMediaResource): og["og:image:height"] = dims['height'] else: logger.warn("Couldn't get dims for %s" % og["og:image"]) - + og["og:image"] = "mxc://%s/%s" % (self.server_name, image_info['filesystem_id']) og["og:image:type"] = image_info['media_type'] else: @@ -259,7 +259,8 @@ class PreviewUrlResource(BaseMediaResource): length, headers, uri = yield self.client.get_file( url, output_stream=f, max_size=self.max_spider_size, ) - # FIXME: handle 404s sanely - don't spider an error page + # FIXME: pass through 404s and other error messages nicely + media_type = headers["Content-Type"][0] time_now_ms = self.clock.time_msec() |