Skip to content

Commit 0b91dfc

Browse files
author
zeloff
committed
update find_exploit_all endpoint
1 parent 6fd42e0 commit 0b91dfc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "vulners"
3-
version = "2.3.1"
3+
version = "2.3.2"
44
description = "Python library and command-line utility for Vulners (https://vulners.com)"
55
readme = "README.md"
66
authors = ["Vulners Team"]

vulners/vulners.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import io
22
import json
3+
import re
34
import warnings
45
import zipfile
56

@@ -156,6 +157,8 @@ def find_exploit_all(
156157
Returns list of the documents.
157158
Use .total to get the total number of found documents.
158159
"""
160+
if re.match(r"^CVE-\d{4}-\d+$", (query := query.strip()), re.IGNORECASE):
161+
query = f'"{query}"'
159162
if lookup_fields:
160163
search_query = "bulletinFamily:exploit AND (%s)" % (
161164
" OR ".join('%s:"%s"' % (field, query) for field in lookup_fields)

0 commit comments

Comments
 (0)