summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/14083.bugfix1
-rw-r--r--synapse/federation/transport/server/federation.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/14083.bugfix b/changelog.d/14083.bugfix
new file mode 100644
index 0000000000..752982b1ca
--- /dev/null
+++ b/changelog.d/14083.bugfix
@@ -0,0 +1 @@
+Fix a long-standing bug where Synapse would error on the optional 'invite_room_state' field not being provided to [`PUT /_matrix/federation/v2/invite/{roomId}/{eventId}`](https://spec.matrix.org/v1.4/server-server-api/#put_matrixfederationv2inviteroomideventid).
\ No newline at end of file
diff --git a/synapse/federation/transport/server/federation.py b/synapse/federation/transport/server/federation.py
index 6bb4659c4c..6f11138b57 100644
--- a/synapse/federation/transport/server/federation.py
+++ b/synapse/federation/transport/server/federation.py
@@ -489,7 +489,7 @@ class FederationV2InviteServlet(BaseFederationServerServlet):
 
         room_version = content["room_version"]
         event = content["event"]
-        invite_room_state = content["invite_room_state"]
+        invite_room_state = content.get("invite_room_state", [])
 
         # Synapse expects invite_room_state to be in unsigned, as it is in v1
         # API