-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Room membership endpoints (/join
, /leave
, /forget
) accept requests with malformed or no bodies
#13388
Comments
@richvdh how was the distinction that this is a spec violation made? There doesn't seem to be anything in the spec which requires a JSON object for empty requests. |
well, it's just always been so, apart from these three endpoints. |
Synapse currently ignores anything that isn't valid json (including actually malformed JSON, like I'd really like just to bring these endpoints into line with every other endpoint. |
I'd prefer to see the spec updated to reflect what is supposed to happen when the caller wants an empty body (in these endpoints' cases, not using the optional parameters). Presently, the behaviour of clients appears legal. |
Related: #10534 (?) |
oh yes, that reminds me: a valid object is required here by the openapi definition: https://github.com/matrix-org/matrix-spec/blob/v1.3/data/api/client-server/joining.yaml#L57, https://github.com/matrix-org/matrix-spec/blob/v1.3/data/api/client-server/leaving.yaml#L57. |
this was done in matrix-org/matrix-spec#1185 |
Do we know which clients rely on this behaviour? #14600 will have made it harder to figure out :(. |
/join
, /leave
, /forget
) accept requests with malformed or no bodies
The following endpoints accept, and ignore, requests with bodies which are not valid JSON objects:
/_matrix/client/v3/join/{roomIdOrAlias}
/_matrix/client/v3/rooms/{roomId}/join
/_matrix/client/v3/rooms/{roomId}/leave
(as well as their non-
v3
equivalents).This is a spec violation, but it appears there are a number of clients that currently rely on it.
The text was updated successfully, but these errors were encountered: