Skip to content

Commit

Permalink
for #3621 (#3668)
Browse files Browse the repository at this point in the history
  • Loading branch information
syapollo authored Aug 24, 2020
1 parent 3428d88 commit 29ba11e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -125,13 +127,13 @@ public boolean login(List<String> servers) {
* @param server server address
* @return true if login successfully
*/
public boolean login(String server) {
public boolean login(String server) throws UnsupportedEncodingException {

if (StringUtils.isNotBlank(username)) {
Map<String, String> params = new HashMap<String, String>(2);
Map<String, String> bodyMap = new HashMap<String, String>(2);
params.put("username", username);
bodyMap.put("password", password);
bodyMap.put("password", URLEncoder.encode(password, "utf-8"));
String url = "http://" + server + contextPath + LOGIN_URL;

if (server.contains(Constants.HTTP_PREFIX)) {
Expand Down

0 comments on commit 29ba11e

Please sign in to comment.