mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-20 17:03:59 +01:00
Make /config more CORS-y
This commit is contained in:
parent
30da50a5b8
commit
dbf736ba66
1 changed files with 3 additions and 1 deletions
|
@ -18,7 +18,7 @@ from twisted.internet import defer
|
||||||
from twisted.web.resource import Resource
|
from twisted.web.resource import Resource
|
||||||
from twisted.web.server import NOT_DONE_YET
|
from twisted.web.server import NOT_DONE_YET
|
||||||
|
|
||||||
from synapse.http.server import respond_with_json, wrap_json_request_handler
|
from synapse.http.server import respond_with_json, wrap_json_request_handler, set_cors_headers
|
||||||
|
|
||||||
|
|
||||||
class MediaConfigResource(Resource):
|
class MediaConfigResource(Resource):
|
||||||
|
@ -40,9 +40,11 @@ class MediaConfigResource(Resource):
|
||||||
@wrap_json_request_handler
|
@wrap_json_request_handler
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _async_render_GET(self, request):
|
def _async_render_GET(self, request):
|
||||||
|
set_cors_headers(request)
|
||||||
yield self.auth.get_user_by_req(request)
|
yield self.auth.get_user_by_req(request)
|
||||||
respond_with_json(request, 200, self.limits_dict)
|
respond_with_json(request, 200, self.limits_dict)
|
||||||
|
|
||||||
def render_OPTIONS(self, request):
|
def render_OPTIONS(self, request):
|
||||||
|
set_cors_headers(request)
|
||||||
respond_with_json(request, 200, {}, send_cors=True)
|
respond_with_json(request, 200, {}, send_cors=True)
|
||||||
return NOT_DONE_YET
|
return NOT_DONE_YET
|
||||||
|
|
Loading…
Reference in a new issue