From 6f47bc3fb2b5617b4355c9c81649d7feb09b790a Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 14 Feb 2019 19:51:33 +0000 Subject: [PATCH 1/5] set CORS on .well-known URI to unbreak modular otherwise a riot/web running on foo.riot.im can't query the .well-known on foo.modular.im... --- synapse/rest/well_known.py | 1 + 1 file changed, 1 insertion(+) diff --git a/synapse/rest/well_known.py b/synapse/rest/well_known.py index 6e043d616230..41d868c6d228 100644 --- a/synapse/rest/well_known.py +++ b/synapse/rest/well_known.py @@ -59,6 +59,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) From bfcefbb230ee5a50d57a03d3d021c476ca4663d8 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 14 Feb 2019 19:53:12 +0000 Subject: [PATCH 2/5] tabs --- synapse/rest/well_known.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/rest/well_known.py b/synapse/rest/well_known.py index 41d868c6d228..d2e500d5641b 100644 --- a/synapse/rest/well_known.py +++ b/synapse/rest/well_known.py @@ -59,7 +59,7 @@ def __init__(self, hs): self._well_known_builder = WellKnownBuilder(hs) def render_GET(self, request): - set_cors_headers(request) + set_cors_headers(request) r = self._well_known_builder.get_well_known() if not r: request.setResponseCode(404) From 04dad5ac16b1776a8a55f9b56193d639e1b9f01a Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 18 Feb 2019 15:59:23 +0100 Subject: [PATCH 3/5] fix missig import --- synapse/rest/well_known.py | 1 + 1 file changed, 1 insertion(+) diff --git a/synapse/rest/well_known.py b/synapse/rest/well_known.py index d2e500d5641b..0d270de8bb5d 100644 --- a/synapse/rest/well_known.py +++ b/synapse/rest/well_known.py @@ -17,6 +17,7 @@ import logging from twisted.web.resource import Resource +from synapse.http.server import set_cors_headers logger = logging.getLogger(__name__) From d9713e916e11f0b965472ee9ec7c7248049fcacd Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 18 Feb 2019 16:00:22 +0100 Subject: [PATCH 4/5] changelog --- changelog.d/4651.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/4651.bugfix diff --git a/changelog.d/4651.bugfix b/changelog.d/4651.bugfix new file mode 100644 index 000000000000..2f8d19e0c08c --- /dev/null +++ b/changelog.d/4651.bugfix @@ -0,0 +1 @@ +set CORS headers on .well-known requests From 092b541401e7ca6a97ab8c659de54ced423ec779 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 18 Feb 2019 15:52:26 +0000 Subject: [PATCH 5/5] Fixup --- changelog.d/4651.bugfix | 2 +- synapse/rest/well_known.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.d/4651.bugfix b/changelog.d/4651.bugfix index 2f8d19e0c08c..15cb1e58c4e5 100644 --- a/changelog.d/4651.bugfix +++ b/changelog.d/4651.bugfix @@ -1 +1 @@ -set CORS headers on .well-known requests +Set CORS headers on .well-known requests diff --git a/synapse/rest/well_known.py b/synapse/rest/well_known.py index 0d270de8bb5d..c0a4ae93e53f 100644 --- a/synapse/rest/well_known.py +++ b/synapse/rest/well_known.py @@ -17,6 +17,7 @@ import logging from twisted.web.resource import Resource + from synapse.http.server import set_cors_headers logger = logging.getLogger(__name__)