Skip to content

Commit 6f82665

Browse files
ridhoqsschuberth
authored andcommitted
enable valid prefix
Signed-off-by: Ridwan Hoq <ridwanhoq@microsoft.com>
1 parent 322020f commit 6f82665

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packageurl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ func (p *PackageURL) Normalize() error {
457457
}
458458
subpath := strings.Trim(p.Subpath, "/")
459459
segs := strings.Split(p.Subpath, "/")
460-
for _, s := range segs {
461-
if s == "." || s == ".." {
460+
for i, s := range segs {
461+
if (s == "." || s == "..") && i != 0 {
462462
return fmt.Errorf("invalid Package URL subpath: %q", p.Subpath)
463463
}
464464
}

0 commit comments

Comments
 (0)