diff options
author | Quentin Gliech <quenting@element.io> | 2024-04-17 16:47:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 16:47:35 +0200 |
commit | c8e0bed4269106c49ffd733eaad5cdb3576f55d2 (patch) | |
tree | ca0dd4b2dcf8be74deb67801b26194a184933e08 /synapse/http/server.py | |
parent | Bump minimum required Rust version to 1.66.0 (#17079) (diff) | |
download | synapse-c8e0bed4269106c49ffd733eaad5cdb3576f55d2.tar.xz |
Support for MSC4108 via delegation (#17086)
This adds support for MSC4108 via delegation, similar to what has been done for MSC3886 --------- Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
Diffstat (limited to 'synapse/http/server.py')
-rw-r--r-- | synapse/http/server.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py index c76500e14f..45b2cbffcd 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -909,7 +909,18 @@ def set_cors_headers(request: "SynapseRequest") -> None: request.setHeader( b"Access-Control-Allow-Methods", b"GET, HEAD, POST, PUT, DELETE, OPTIONS" ) - if request.experimental_cors_msc3886: + if request.path is not None and request.path.startswith( + b"/_matrix/client/unstable/org.matrix.msc4108/rendezvous" + ): + request.setHeader( + b"Access-Control-Allow-Headers", + b"Content-Type, If-Match, If-None-Match", + ) + request.setHeader( + b"Access-Control-Expose-Headers", + b"Synapse-Trace-Id, Server, ETag", + ) + elif request.experimental_cors_msc3886: request.setHeader( b"Access-Control-Allow-Headers", b"X-Requested-With, Content-Type, Authorization, Date, If-Match, If-None-Match", |