From 5f78427893718c835e505974863bb92bd4d56fc5 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 14 Feb 2024 22:09:53 +0100 Subject: [PATCH] Use uri_string module instead of the deprecated http_uri http_uri is marked for deprecation since OTP 23 Use uri_string which is available since OTP 21 No need to provide alternative, because it's used only by mod_matrix, and this runs only with Erlang/OTP 24 or higher. https://www.erlang.org/patches/otp-23.0#inets-7.2 https://www.erlang.org/docs/23/man/http_uri --- src/mod_matrix_gw.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod_matrix_gw.erl b/src/mod_matrix_gw.erl index 929cdc47748..a1e3905a3a2 100644 --- a/src/mod_matrix_gw.erl +++ b/src/mod_matrix_gw.erl @@ -743,7 +743,7 @@ sign_json(Host, JSON) -> send_request(Host, Method, MatrixServer, Path, Query, JSON, HTTPOptions, Options) -> URI1 = iolist_to_binary( - lists:map(fun(P) -> [$/, http_uri:encode(P)] end, Path)), + lists:map(fun(P) -> [$/, uri_string:quote(P)] end, Path)), URI = case Query of [] -> URI1; @@ -751,7 +751,7 @@ send_request(Host, Method, MatrixServer, Path, Query, JSON, URI2 = str:join( lists:map( fun({K, V}) -> - [http_uri:encode(K), $=, http_uri:encode(V)] + [uri_string:quote(K), $=, uri_string:quote(V)] end, Query), $&), <> end,