Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2707 from matrix-org/rav/fix_urlpreview
Browse files Browse the repository at this point in the history
Fix OPTIONS on preview_url
  • Loading branch information
richvdh authored Nov 27, 2017
2 parents 96387bd + 8132a6b commit 7ef22a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion synapse/rest/media/v1/preview_url_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
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
Expand Down Expand Up @@ -78,6 +79,9 @@ def __init__(self, hs, media_repo):
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
Expand Down

0 comments on commit 7ef22a4

Please sign in to comment.