Skip to content

Commit

Permalink
Fix composer name and namespace parsing. They must be lowercase, as s…
Browse files Browse the repository at this point in the history
  • Loading branch information
Octogonapus committed Jun 15, 2023
1 parent 7e18e09 commit 2e2d03f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packageurl.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func FromString(purl string) (PackageURL, error) {
// See https://github.com/package-url/purl-spec#known-purl-types
func typeAdjustNamespace(purlType, ns string) string {
switch purlType {
case TypeBitbucket, TypeDebian, TypeGithub, TypeGolang, TypeNPM, TypeRPM:
case TypeBitbucket, TypeDebian, TypeGithub, TypeGolang, TypeNPM, TypeRPM, TypeComposer:
return strings.ToLower(ns)
}
return ns
Expand All @@ -357,7 +357,7 @@ func typeAdjustNamespace(purlType, ns string) string {
func typeAdjustName(purlType, name string, qualifiers Qualifiers) string {
quals := qualifiers.Map()
switch purlType {
case TypeBitbucket, TypeDebian, TypeGithub, TypeGolang, TypeNPM:
case TypeBitbucket, TypeDebian, TypeGithub, TypeGolang, TypeNPM, TypeComposer:
return strings.ToLower(name)
case TypePyPi:
return strings.ToLower(strings.ReplaceAll(name, "_", "-"))
Expand Down

0 comments on commit 2e2d03f

Please sign in to comment.