From 968e6432ed4f12d4b2e4d8a99ce548554cd6a782 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 20 Aug 2021 08:27:45 +1000 Subject: [PATCH 1/2] Actually fix US Core 4.0.0 references --- .../src/main/java/org/hl7/fhir/utilities/npm/PackageHacker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageHacker.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageHacker.java index 928e7d0d3..ae63fbc85 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageHacker.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageHacker.java @@ -142,7 +142,7 @@ public class PackageHacker { // https://github.com/HL7/fhir-ig-publisher/issues/295 if (webref.contains("hl7.org/fhir/us/core/STU4.0.0")) { - webref.replace("hl7.org/fhir/us/core/STU4.0.0", "hl7.org/fhir/us/core/STU4"); + return webref.replace("hl7.org/fhir/us/core/STU4.0.0", "hl7.org/fhir/us/core/STU4"); } if (isUseSecureReferences()) { From 36413d55b80d9006d461837664a1603ff0fc84c5 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 20 Aug 2021 08:28:11 +1000 Subject: [PATCH 2/2] fix up isAbsoluteUrl check --- .../src/main/java/org/hl7/fhir/utilities/Utilities.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java index 4a4a53ea3..9a6d306ca 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java @@ -1095,7 +1095,9 @@ public class Utilities { public static boolean isAbsoluteUrl(String ref) { if (ref != null && ref.contains(":")) { String scheme = ref.substring(0, ref.indexOf(":")); - return existsInList(scheme, "http", "https", "urn") || isToken(scheme) || Utilities.startsWithInList(ref, "urn:iso:", "urn:iso-iec:", "urn:iso-cie:", "urn:iso-astm:", "urn:iso-ieee:", "urn:iec:"); // rfc5141 + String details = ref.substring(ref.indexOf(":")+1); + return (existsInList(scheme, "http", "https", "urn") || isToken(scheme) || Utilities.startsWithInList(ref, "urn:iso:", "urn:iso-iec:", "urn:iso-cie:", "urn:iso-astm:", "urn:iso-ieee:", "urn:iec:")) + && details != null && details.length() > 0 && !details.contains(" "); // rfc5141 } return false; }