diff --git a/packageurl.go b/packageurl.go index d200ab5..0dd89a7 100644 --- a/packageurl.go +++ b/packageurl.go @@ -457,8 +457,8 @@ func (p *PackageURL) Normalize() error { } subpath := strings.Trim(p.Subpath, "/") segs := strings.Split(p.Subpath, "/") - for _, s := range segs { - if s == "." || s == ".." { + for i, s := range segs { + if (s == "." || s == "..") && i != 0 { return fmt.Errorf("invalid Package URL subpath: %q", p.Subpath) } }