Stop returning `unsigned.invite_room_state` in `PUT /_matrix/federation/v2/invite/{roomId}/{eventId}` responses (#14064)

Co-authored-by: David Robertson <davidr@element.io>
pull/14258/head
Andrew Morgan 2022-10-20 15:17:45 +01:00 committed by GitHub
parent 09c602b558
commit da2c93d4b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

1
changelog.d/14064.bugfix Normal file
View File

@ -0,0 +1 @@
Fix a long-standing bug where Synapse would accidentally include extra information in the response to [`PUT /_matrix/federation/v2/invite/{roomId}/{eventId}`](https://spec.matrix.org/v1.4/server-server-api/#put_matrixfederationv2inviteroomideventid).

View File

@ -499,6 +499,11 @@ class FederationV2InviteServlet(BaseFederationServerServlet):
result = await self.handler.on_invite_request( result = await self.handler.on_invite_request(
origin, event, room_version_id=room_version origin, event, room_version_id=room_version
) )
# We only store invite_room_state for internal use, so remove it before
# returning the event to the remote homeserver.
result["event"].get("unsigned", {}).pop("invite_room_state", None)
return 200, result return 200, result