summary refs log tree commit diff
path: root/synapse/rest/media
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2016-04-03 02:02:46 +0100
committerMatthew Hodgson <matthew@matrix.org>2016-04-03 02:02:46 +0100
commiteab4d462f8e5d17c5ca7592d1ea15d8e4771a00c (patch)
treea27fd6a02cad014e41ed46dc41dc1655bc09e531 /synapse/rest/media
parentrebase all image URLs (diff)
downloadsynapse-eab4d462f8e5d17c5ca7592d1ea15d8e4771a00c.tar.xz
fix etag typing error. fix timestamp typing error
Diffstat (limited to 'synapse/rest/media')
-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 31ce2b5831..7c69c01a6c 100644
--- a/synapse/rest/media/v1/preview_url_resource.py
+++ b/synapse/rest/media/v1/preview_url_resource.py
@@ -61,7 +61,7 @@ class PreviewUrlResource(BaseMediaResource):
             # XXX: if get_user_by_req fails, what should we do in an async render?
             requester = yield self.auth.get_user_by_req(request)
             url = request.args.get("url")[0]
-            ts = request.args.get("ts")[0] if "ts" in request.args else self.clock.time_msec()
+            ts = int(request.args.get("ts")[0]) if "ts" in request.args else self.clock.time_msec()
 
             # first check the memory cache - good to handle all the clients on this
             # HS thundering away to preview the same URL at the same time.
@@ -368,7 +368,7 @@ class PreviewUrlResource(BaseMediaResource):
             # FIXME: we should calculate a proper expiration based on the
             # Cache-Control and Expire headers.  But for now, assume 1 hour.
             "expires": 60 * 60 * 1000,
-            "etag": headers["ETag"] if "ETag" in headers else None,
+            "etag": headers["ETag"][0] if "ETag" in headers else None,
         })
 
     def _is_media(self, content_type):