Skip to content

Commit 3d64201

Browse files
authored
JoinRoom: send with empty JSON body for spec compliance (#562)
When joining a room, it is erroneous to send an empty POST body. Send an empty JSON body instead.
1 parent 1c13fff commit 3d64201

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/client/client.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ func (c *CSAPI) JoinRoom(t *testing.T, roomIDOrAlias string, serverNames []strin
141141
query.Add("server_name", serverName)
142142
}
143143
// join the room
144-
res := c.MustDoFunc(t, "POST", []string{"_matrix", "client", "v3", "join", roomIDOrAlias}, WithQueries(query))
144+
res := c.MustDoFunc(
145+
t, "POST", []string{"_matrix", "client", "v3", "join", roomIDOrAlias},
146+
WithQueries(query), WithJSONBody(t, map[string]interface{}{}),
147+
)
145148
// return the room ID if we joined with it
146149
if roomIDOrAlias[0] == '!' {
147150
return roomIDOrAlias

0 commit comments

Comments
 (0)