Skip to content

Commit

Permalink
simply telnet command enabled check logic (#3316)
Browse files Browse the repository at this point in the history
* simply telnet command enabled check
  • Loading branch information
kexianjun authored and carryxyh committed Jan 23, 2019
1 parent b4aa515 commit babf0d1
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,17 @@ public String telnet(Channel channel, String message) throws RemotingException {
}

private boolean commandEnabled(URL url, String command) {
boolean commandEnable = false;
String supportCommands = url.getParameter(Constants.TELNET);
if (StringUtils.isEmpty(supportCommands)) {
commandEnable = true;
} else {
String[] commands = Constants.COMMA_SPLIT_PATTERN.split(supportCommands);
for (String c : commands) {
if (command.equals(c)) {
commandEnable = true;
break;
}
return true;
}
String[] commands = Constants.COMMA_SPLIT_PATTERN.split(supportCommands);
for (String c : commands) {
if (command.equals(c)) {
return true;
}
}
return commandEnable;
return false;
}

}

0 comments on commit babf0d1

Please sign in to comment.