Merge pull request #4651 from matrix-org/matthew/well-known-cors
set CORS on .well-known URI to unbreak modular
This commit is contained in:
commit
d08bac4136
|
@ -0,0 +1 @@
|
||||||
|
Set CORS headers on .well-known requests
|
|
@ -18,6 +18,8 @@ import logging
|
||||||
|
|
||||||
from twisted.web.resource import Resource
|
from twisted.web.resource import Resource
|
||||||
|
|
||||||
|
from synapse.http.server import set_cors_headers
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,6 +61,7 @@ class WellKnownResource(Resource):
|
||||||
self._well_known_builder = WellKnownBuilder(hs)
|
self._well_known_builder = WellKnownBuilder(hs)
|
||||||
|
|
||||||
def render_GET(self, request):
|
def render_GET(self, request):
|
||||||
|
set_cors_headers(request)
|
||||||
r = self._well_known_builder.get_well_known()
|
r = self._well_known_builder.get_well_known()
|
||||||
if not r:
|
if not r:
|
||||||
request.setResponseCode(404)
|
request.setResponseCode(404)
|
||||||
|
|
Loading…
Reference in New Issue