Skip to content

Commit b5a48a9

Browse files
committed
expose find_all_cve helper
Provide a helper for uniform cve search in importers. Based on #393 (comment) Signed-off-by: Hritik Vijay <hritikxx8@gmail.com>
1 parent 9ff0192 commit b5a48a9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

vulnerabilities/helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ def create_etag(data_src, url, etag_key):
7979
return True
8080

8181

82-
is_cve = re.compile(r"CVE-\d{4}-\d{4,7}", re.IGNORECASE).match
82+
cve_regex = re.compile(r"CVE-\d{4}-\d{4,7}", re.IGNORECASE)
83+
is_cve = cve_regex.match
84+
find_all_cve = cve_regex.findall
8385

8486

8587
def requests_with_5xx_retry(max_retries=5, backoff_factor=0.5):

0 commit comments

Comments
 (0)