0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

modules/client/publicrooms: Fix url decoding of query string arguments.

This commit is contained in:
Jason Volk 2019-06-18 00:15:51 -07:00
parent f2fb177d7d
commit cef538fdf3

View file

@ -52,11 +52,12 @@ resource::response
get__publicrooms(client &client, get__publicrooms(client &client,
const resource::request &request) const resource::request &request)
{ {
char since_buf[256];
const string_view &since const string_view &since
{ {
request.has("since")? request.has("since")?
unquote(request["since"]): unquote(request["since"]):
request.query["since"] url::decode(since_buf, request.query["since"])
}; };
if(since && !valid(m::id::ROOM, since)) if(since && !valid(m::id::ROOM, since))
@ -65,9 +66,10 @@ get__publicrooms(client &client,
"Invalid since token for this server." "Invalid since token for this server."
}; };
char server_buf[256];
const auto &server const auto &server
{ {
request.query["server"] url::decode(server_buf, request.query["server"])
}; };
const json::object &filter const json::object &filter