File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131from vulnerabilities .references import WireSharkReference
3232from vulnerabilities .references import XsaReference
3333from vulnerabilities .references import ZbxReference
34+ from vulnerabilities .utils import fetch_response
3435from vulnerabilities .utils import is_cve
3536
3637LOGGER = logging .getLogger (__name__ )
@@ -58,16 +59,6 @@ def advisory_data(self) -> Iterable[AdvisoryData]:
5859 yield from process_record (record )
5960
6061
61- def fetch_response (url ):
62- """
63- Fetch and return `response` from the `url`
64- """
65- response = requests .get (url )
66- if response .status_code == 200 :
67- return response
68- raise Exception (f"Failed to fetch data from { url !r} with status code: { response .status_code !r} " )
69-
70-
7162def fetch_advisory_directory_links (page_response_content : str ) -> List [str ]:
7263 """
7364 Return a list of advisory directory links present in `page_response_content` html string
Original file line number Diff line number Diff line change @@ -412,8 +412,6 @@ def base32_custom(btes):
412412 return bytes (encoded )
413413
414414
415- # 9/28/2022 Wednesday 1:07:41 PM.Copy from /home/jmh/dev/nexb/vulnerablecode/vulnerabilities/importers/alpine_linux.py
416- # for use in /home/jmh/dev/nexb/vulnerablecode/vulnerabilities/importers/archlinux.py
417415def fetch_response (url ):
418416 """
419417 Fetch and return `response` from the `url`
You can’t perform that action at this time.
0 commit comments