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

Fix OPTIONS on preview_url #2707

Merged
merged 1 commit into from
Nov 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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