From c7f4dc8afa1acb5672dde95d1ab8e11a3465b43a Mon Sep 17 00:00:00 2001 From: Xavi Aracil Date: Mon, 12 Dec 2022 10:41:04 +0100 Subject: [PATCH] Fixed regular expression validation --- .../vc/probe/validation/ValidationIssuerPropertyProbe.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/validation/ValidationIssuerPropertyProbe.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/validation/ValidationIssuerPropertyProbe.java index 62ab1d4..a9ebb17 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/validation/ValidationIssuerPropertyProbe.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/validation/ValidationIssuerPropertyProbe.java @@ -1,5 +1,7 @@ package org.oneedtech.inspect.vc.probe.validation; +import java.util.regex.Pattern; + import org.oneedtech.inspect.core.probe.RunContext; import org.oneedtech.inspect.core.report.ReportItems; import org.oneedtech.inspect.vc.Validation; @@ -24,7 +26,7 @@ public class ValidationIssuerPropertyProbe extends ValidationPropertyProbe { @Override protected ReportItems validate(JsonNode node, RunContext ctx) { - if (!node.asText().matches("^http(s)?://")) { + if (!Pattern.compile("^http(s)?://.+", Pattern.CASE_INSENSITIVE).matcher(node.asText()).matches()) { return buildResponse("Issuer Profile " + node.toString() + " not hosted with HTTP-based identifier." + "Many platforms can only handle HTTP(s)-hosted issuers.", ctx); }