Merge pull request #67 from Metori/master

Fixed issue with special chars in login credentials
This commit is contained in:
Gideon le Grange 2019-10-04 15:04:51 +02:00 committed by GitHub
commit 7aac1b95e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -55,7 +55,10 @@ public final class ApiConnectionImpl extends ApiConnection {
if (username.trim().isEmpty()) {
throw new ApiConnectionException("API username cannot be empty");
}
List<Map<String, String>> list = execute("/login name=" + username + " password=" + password);
Command cmd = new Command("/login");
cmd.addParameter("name", username);
cmd.addParameter("password", password);
List<Map<String, String>> list = execute(cmd, timeout);
if (!list.isEmpty()) {
Map<String, String> res = list.get(0);
if (res.containsKey("ret")) {