Skip to content
Snippets Groups Projects
Commit be423a67 authored by Konstantinos Sideris's avatar Konstantinos Sideris
Browse files

Url encode transcation ids

parent ae2258d8
No related branches found
No related tags found
No related merge requests found
......@@ -522,8 +522,9 @@ mtx::http::Client::send_room_message(const std::string &room_id,
const Payload &payload,
Callback<mtx::responses::EventId> callback)
{
const auto api_path =
"/client/r0/rooms/" + room_id + "/send/" + mtx::events::to_string(Event) + "/" + txn_id;
const auto api_path = "/client/r0/rooms/" + room_id + "/send/" +
mtx::events::to_string(Event) + "/" +
mtx::client::utils::url_encode(txn_id);
put<Payload, mtx::responses::EventId>(api_path, payload, callback);
}
......
......@@ -439,11 +439,12 @@ Client::flow_response(const std::string &user,
void
Client::send_to_device(const std::string &event_type,
const std::string &txid,
const std::string &txn_id,
const nlohmann::json &body,
ErrCallback callback)
{
const auto api_path = "/client/r0/sendToDevice/" + event_type + "/" + txid;
const auto api_path =
"/client/r0/sendToDevice/" + event_type + "/" + mtx::client::utils::url_encode(txn_id);
put<nlohmann::json>(api_path, body, callback);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment