Skip to content

Commit

Permalink
enable valid prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Ridwan Hoq <ridwanhoq@microsoft.com>
  • Loading branch information
ridhoq committed Dec 2, 2023
1 parent c4008f7 commit 926d47a
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 @@ -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)
}
}
Expand Down

0 comments on commit 926d47a

Please sign in to comment.