Skip to content

Commit 2917ab8

Browse files
committed
Fixed additional edge case for purl with single qualifier that has a key but no value
1 parent d0db489 commit 2917ab8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/controller/cve.controller/cve.middleware.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ function purlValidateHelper (affected) {
225225
if (Object.keys(purlObj.qualifiers).includes('vers')) {
226226
throw new Error('PURL versions are currently not supported by the CVE schema: ' + purlStr)
227227
}
228+
}
228229

230+
if (parsedPurlArray[4] !== undefined) {
229231
// Check for qualifier with key but no value
230232
if ((Array.from(parsedPurlArray[4].values()).includes(''))) {
231233
throw new Error('Qualifier keys must have a value: ' + purlStr)

0 commit comments

Comments
 (0)