mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Add Synapse-Trace-Id to access-control-expose-headers header (#14974)
This commit is contained in:
parent
63e25010d6
commit
5ab7146e19
1
changelog.d/14974.misc
Normal file
1
changelog.d/14974.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Add `Synapse-Trace-Id` to `access-control-expose-headers` header.
|
@ -892,6 +892,10 @@ def set_cors_headers(request: SynapseRequest) -> None:
|
|||||||
b"Access-Control-Allow-Headers",
|
b"Access-Control-Allow-Headers",
|
||||||
b"X-Requested-With, Content-Type, Authorization, Date",
|
b"X-Requested-With, Content-Type, Authorization, Date",
|
||||||
)
|
)
|
||||||
|
request.setHeader(
|
||||||
|
b"Access-Control-Expose-Headers",
|
||||||
|
b"Synapse-Trace-Id",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def set_corp_headers(request: Request) -> None:
|
def set_corp_headers(request: Request) -> None:
|
||||||
|
@ -266,6 +266,10 @@ class OptionsResourceTests(unittest.TestCase):
|
|||||||
[b"X-Requested-With, Content-Type, Authorization, Date"],
|
[b"X-Requested-With, Content-Type, Authorization, Date"],
|
||||||
"has correct CORS Headers header",
|
"has correct CORS Headers header",
|
||||||
)
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
channel.headers.getRawHeaders(b"Access-Control-Expose-Headers"),
|
||||||
|
[b"Synapse-Trace-Id"],
|
||||||
|
)
|
||||||
|
|
||||||
def _check_cors_msc3886_headers(self, channel: FakeChannel) -> None:
|
def _check_cors_msc3886_headers(self, channel: FakeChannel) -> None:
|
||||||
# Ensure the correct CORS headers have been added
|
# Ensure the correct CORS headers have been added
|
||||||
|
Loading…
Reference in New Issue
Block a user