From 2b0fd49957bf0e7e2f830a9f6a7c9a1622cfa0eb Mon Sep 17 00:00:00 2001 From: Xavi Aracil Date: Thu, 28 Sep 2023 08:01:52 +0200 Subject: [PATCH] Decode domain in did:web method. --- .../org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java index 2b57b1e..5666fc1 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java @@ -2,6 +2,7 @@ package org.oneedtech.inspect.vc.probe; import java.io.StringReader; import java.net.URI; +import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.charset.Charset; import java.util.List; @@ -111,7 +112,7 @@ public class EmbeddedProofProbe extends Probe { methodSpecificId = methodSpecificId.replaceAll(":", "/"); // 2. If the domain contains a port percent decode the colon. - String portPercentEncoded = URLEncoder.encode(":", Charset.forName("UTF-8")); + String portPercentEncoded = URLDecoder.decode(":", Charset.forName("UTF-8")); int index = methodSpecificId.indexOf(portPercentEncoded); if (index >= 0 && index < methodSpecificId.indexOf("/")) { methodSpecificId = methodSpecificId.replace(portPercentEncoded, ":");