summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-11-23 17:52:31 +0000
committerRichard van der Hoff <richard@matrix.org>2017-11-23 17:52:31 +0000
commit8132a6b7ac909b6771ee78ab3593d7d7f7e7ef2c (patch)
tree256467def00ab364b78426cf3136f00126fb3248 /synapse/rest
parentMerge pull request #2701 from matrix-org/rav/one_mediarepo_to_rule_them_all (diff)
downloadsynapse-8132a6b7ac909b6771ee78ab3593d7d7f7e7ef2c.tar.xz
Fix OPTIONS on preview_url
Fixes #2706
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/media/v1/preview_url_resource.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py
index 723f7043f4..65f86be205 100644
--- a/synapse/rest/media/v1/preview_url_resource.py
+++ b/synapse/rest/media/v1/preview_url_resource.py
@@ -25,7 +25,8 @@ from synapse.util.stringutils import random_string
 from synapse.util.caches.expiringcache import ExpiringCache
 from synapse.http.client import SpiderHttpClient
 from synapse.http.server import (
-    request_handler, respond_with_json_bytes
+    request_handler, respond_with_json_bytes,
+    respond_with_json,
 )
 from synapse.util.async import ObservableDeferred
 from synapse.util.stringutils import is_ascii
@@ -78,6 +79,9 @@ class PreviewUrlResource(Resource):
             self._expire_url_cache_data, 10 * 1000
         )
 
+    def render_OPTIONS(self, request):
+        return respond_with_json(request, 200, {}, send_cors=True)
+
     def render_GET(self, request):
         self._async_render_GET(request)
         return NOT_DONE_YET