Skip to content

Commit cc1fa36

Browse files
committed
update hardcoded version check
1 parent df3d96c commit cc1fa36

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/java/com/uid2/operator/StatsCollectorVerticleTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ void allValidPathsAllowed(Vertx vertx, VertxTestContext testContext) throws Inte
112112
var messages = getMessages();
113113
for(String endpoint: validEndpoints) {
114114
String withoutVersion = endpoint;
115-
if (endpoint.startsWith("/v1/") || endpoint.startsWith("/v2/") || endpoint.startsWith("/v3/")) {
116-
withoutVersion = endpoint.substring(4);
115+
if (endpoint.matches("^/v\\d+/.*")) {
116+
withoutVersion = endpoint.substring(endpoint.indexOf("/", 1) + 1);
117117
} else if (endpoint.startsWith("/")) {
118118
withoutVersion = endpoint.substring(1);
119119
}

0 commit comments

Comments
 (0)