fix: prevent requests from failing
Encode userId to handle the case of a localpart with a forward slash
Fixes: https://github.com/Awesome-Technologies/synapse-admin/issues/258
Fix this?
- #111
- #258
The specification does not seem to forbid any characters for the local part of roomId (https://spec.matrix.org/v1.3/appendices/#room-ids-and-event-ids). However, it is the server that is responsible for generating this Id. Indeed, the endpoint to create a room does not take into account a possible roomId as parameter (https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3createroom). And in the case of Synapse, the local part is only composed of alphabetical characters (https://github.com/matrix-org/synapse/blob/develop/synapse/handlers/room.py#L1167), unless you manually call the store_room() primitive. Despite issue #111, I don't see in which situation this can happen. Also I haven't located the Synapse code that takes care of unquote to know if all parameters extracted from an endpoint are processed or only some like userId...
So this PR currently fixes #258 but only partially #111