Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add Server to Access-Control-Expose-Headers header #15908

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/15908.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `Server` to Access-Control-Expose-Headers header.
2 changes: 1 addition & 1 deletion synapse/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ def set_cors_headers(request: SynapseRequest) -> None:
)
request.setHeader(
b"Access-Control-Expose-Headers",
b"Synapse-Trace-Id",
b"Synapse-Trace-Id, Server",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aside: the header should probably have been called X-Synapse-Trace-Id

)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def _check_cors_standard_headers(self, channel: FakeChannel) -> None:
)
self.assertEqual(
channel.headers.getRawHeaders(b"Access-Control-Expose-Headers"),
[b"Synapse-Trace-Id"],
[b"Synapse-Trace-Id, Server"],
)

def _check_cors_msc3886_headers(self, channel: FakeChannel) -> None:
Expand Down