File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
main/java/com/github/packageurl/internal Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 2222package com .github .packageurl .internal ;
2323
2424import static java .lang .Byte .toUnsignedInt ;
25-
26- import com .github .packageurl .ValidationException ;
2725import java .nio .charset .StandardCharsets ;
26+
2827import org .jspecify .annotations .NonNull ;
2928
29+ import com .github .packageurl .ValidationException ;
30+
3031/**
3132 * String utility for validation and encoding.
3233 *
@@ -52,6 +53,13 @@ public final class StringUtil {
5253 UNRESERVED_CHARS ['.' ] = true ;
5354 UNRESERVED_CHARS ['_' ] = true ;
5455 UNRESERVED_CHARS ['~' ] = true ;
56+
57+ /*
58+ According to purl-spec https://github.com/package-url/purl-spec/blob/0c3bc118ac5c001e067ba42fba8501405514f1a9/docs/standard/characters-and-encoding.md
59+ > The following characters must not be percent-encoded:
60+ > - the colon ':', whether used as a Separator Character or otherwise
61+ */
62+ UNRESERVED_CHARS [':' ] = true ;
5563 }
5664
5765 private StringUtil () {
Original file line number Diff line number Diff line change 8686 {
8787 "description" : " docker uses qualifiers and hash image id as versions" ,
8888 "purl" : " pkg:docker/customer/dockerimage@sha256:244fd47e07d1004f0aed9c?repository_url=gcr.io" ,
89- "canonical_purl" : " pkg:docker/customer/dockerimage@sha256%3A244fd47e07d1004f0aed9c ?repository_url=gcr.io" ,
89+ "canonical_purl" : " pkg:docker/customer/dockerimage@sha256:244fd47e07d1004f0aed9c ?repository_url=gcr.io" ,
9090 "type" : " docker" ,
9191 "namespace" : " customer" ,
9292 "name" : " dockerimage" ,
You can’t perform that action at this time.
0 commit comments