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 #4651 from matrix-org/matthew/well-known-cors
Browse files Browse the repository at this point in the history
 set CORS on .well-known URI to unbreak modular
  • Loading branch information
erikjohnston authored Feb 18, 2019
2 parents c30f73c + 092b541 commit d08bac4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/4651.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set CORS headers on .well-known requests
3 changes: 3 additions & 0 deletions synapse/rest/well_known.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

from twisted.web.resource import Resource

from synapse.http.server import set_cors_headers

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -59,6 +61,7 @@ def __init__(self, hs):
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)
Expand Down

0 comments on commit d08bac4

Please sign in to comment.