Skip to content

Commit

Permalink
GG-20428 Backport to 8.8-master of GG-20371 Trimmed WC agent argument…
Browse files Browse the repository at this point in the history
…s. (#214)

(cherry picked from commit 6ccbbfe)
  • Loading branch information
vsisko authored and vsisko committed Jun 27, 2019
1 parent 870e225 commit 376d677
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Expand Up @@ -31,6 +31,7 @@

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.ignite.console.agent.AgentUtils.secured;
import static org.apache.ignite.console.agent.AgentUtils.trim;

/**
* Agent configuration.
Expand Down Expand Up @@ -590,6 +591,10 @@ public void merge(AgentConfiguration cfg) {

if (cipherSuites == null)
cipherSuites(cfg.cipherSuites());

tokens = trim(tokens);
nodeURIs = trim(nodeURIs);
cipherSuites = trim(cipherSuites);
}


Expand Down
Expand Up @@ -300,4 +300,14 @@ public static <K, V> Map.Entry<K, V> entry(K key, V val) {
public static void send(Session ses, WebSocketEvent evt) throws Exception {
ses.getRemote().sendStringByFuture(toJson(evt)).get();
}

/**
* Trim all elements in list and return new list.
*
* @param lst List of elements to trim.
* @return List with trimmed values.
*/
public static List<String> trim(List<String> lst) {
return F.isEmpty(lst) ? lst : lst.stream().map(String::trim).collect(toList());
}
}

0 comments on commit 376d677

Please sign in to comment.