Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2020-04-01 16:34:44 +0300
committerPaweł Chmielowski <pchmielowski@process-one.net>2020-04-01 18:11:19 +0300
commitccb47a67c45d465a315a883b806139173a0bd407 (patch)
tree5ae5479aa6634267d7a9a11d5e40932ce32b20df
parenta2e6d8bb6b3e17206e8ad519ed833802fe3db41c (diff)
Don't replace %25 in webadmin test on older erlangs
It seems that is a bug in R21+ httpc, so let's try to keep that test working with older versions
-rw-r--r--test/webadmin_tests.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/webadmin_tests.erl b/test/webadmin_tests.erl
index 49e9715b9..5af0240fd 100644
--- a/test/webadmin_tests.erl
+++ b/test/webadmin_tests.erl
@@ -91,7 +91,7 @@ changepassword(Config) ->
++ "/user/" ++ binary_to_list(mue(User)) ++ "/",
<<"password=", (mue(Password))/binary,
"&chpassword=Change+Password">>),
- Password = ejabberd_auth:get_password(User, Server),
+ ?match(Password, ejabberd_auth:get_password(User, Server)),
?match({_, _}, binary:match(Body, <<"<p class='result'>Submitted</p>">>)).
removeuser(Config) ->
@@ -126,7 +126,12 @@ page(Config, Tail) ->
Server = ?config(server_host, Config),
Port = ct:get_config(web_port, 5280),
Url = "http://" ++ Server ++ ":" ++ integer_to_list(Port) ++ "/admin/" ++ Tail,
- string:replace(Url, "%25", "%2525"). % Required by httpc:request for paths in URLs
+ case catch uri_string:normalize("/%2525") of
+ "/%25" ->
+ string:replace(Url, "%25", "%2525", all);
+ _ ->
+ Url
+ end.
mue(Binary) ->
misc:url_encode(Binary).