From d122abd2e16ae612d979bba58222c81ac87d9eb2 Mon Sep 17 00:00:00 2001 From: Paul Mathews Date: Wed, 25 Sep 2024 09:56:03 +1000 Subject: [PATCH] Allow npm namespaces to be case-sensitive --- packageurl.go | 1 - packageurl_test.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packageurl.go b/packageurl.go index 5177228..c0d46fc 100644 --- a/packageurl.go +++ b/packageurl.go @@ -566,7 +566,6 @@ func typeAdjustNamespace(purlType, ns string) string { TypeDebian, TypeGithub, TypeGolang, - TypeNPM, TypeRPM, TypeQpkg: return strings.ToLower(ns) diff --git a/packageurl_test.go b/packageurl_test.go index 6fa8c8d..9624228 100644 --- a/packageurl_test.go +++ b/packageurl_test.go @@ -515,12 +515,12 @@ func TestNormalize(t *testing.T) { }, { name: "known type namespace adjustments", input: packageurl.PackageURL{ - Type: "npm", + Type: "apk", Namespace: "NaMeSpAcE", Name: "pkg", }, want: packageurl.PackageURL{ - Type: "npm", + Type: "apk", Namespace: "namespace", Name: "pkg", Qualifiers: packageurl.Qualifiers{},