Skip to content

Commit

Permalink
expose find_all_cve helper
Browse files Browse the repository at this point in the history
Provide a helper for uniform cve search in importers.
Based on aboutcode-org#393 (comment)

Signed-off-by: Hritik Vijay <hritikxx8@gmail.com>
  • Loading branch information
Hritik14 committed Apr 19, 2021
1 parent 9ff0192 commit b5a48a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vulnerabilities/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def create_etag(data_src, url, etag_key):
return True


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


def requests_with_5xx_retry(max_retries=5, backoff_factor=0.5):
Expand Down

0 comments on commit b5a48a9

Please sign in to comment.