Merge pull request #4651 from matrix-org/matthew/well-known-cors

set CORS on .well-known URI to unbreak modular
pull/4676/head
Erik Johnston 2019-02-18 16:38:11 +00:00 committed by GitHub
commit d08bac4136
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

1
changelog.d/4651.bugfix Normal file
View File

@ -0,0 +1 @@
Set CORS headers on .well-known requests

View File

@ -18,6 +18,8 @@ import logging
from twisted.web.resource import Resource
from synapse.http.server import set_cors_headers
logger = logging.getLogger(__name__)
@ -59,6 +61,7 @@ class WellKnownResource(Resource):
self._well_known_builder = WellKnownBuilder(hs)
def render_GET(self, request):
set_cors_headers(request)
r = self._well_known_builder.get_well_known()
if not r:
request.setResponseCode(404)