Allow dashes in ethstats password (#5090)

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
pull/5095/head
Simon Dudley 2 years ago committed by GitHub
parent 97edc67c30
commit 7b81ff0e04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ethereum/ethstats/src/main/java/org/hyperledger/besu/ethstats/util/NetstatsUrl.java
  2. 4
      ethereum/ethstats/src/test/java/org/hyperledger/besu/ethstats/util/NetstatsUrlTest.java

@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory;
@Value.Immutable
public interface NetstatsUrl {
Pattern NETSTATS_URL_REGEX = Pattern.compile("([-\\w]+):([\\w]+)?@([-.\\w]+)(:([\\d]+))?");
Pattern NETSTATS_URL_REGEX = Pattern.compile("([-\\w]+):([-\\w]+)?@([-.\\w]+)(:([\\d]+))?");
String getNodeName();

@ -21,7 +21,7 @@ import org.junit.Test;
public class NetstatsUrlTest {
private final String VALID_NETSTATS_URL = "Dev-Node-1:secret@127.0.0.1:3001";
private final String VALID_NETSTATS_URL = "Dev-Node-1:secret-with-dashes@127.0.0.1:3001";
private final String CONTACT = "contact@mail.fr";
@ -34,7 +34,7 @@ public class NetstatsUrlTest {
assertThat(netstatsUrl.getHost()).isEqualTo("127.0.0.1");
assertThat(netstatsUrl.getNodeName()).isEqualTo("Dev-Node-1");
assertThat(netstatsUrl.getPort()).isEqualTo(3001);
assertThat(netstatsUrl.getSecret()).isEqualTo("secret");
assertThat(netstatsUrl.getSecret()).isEqualTo("secret-with-dashes");
assertThat(netstatsUrl.getContact()).isEqualTo(CONTACT);
}

Loading…
Cancel
Save