Skip to content

Commit 3b3ea6d

Browse files
authored
Merge pull request #1450 from thebigbone/main
use https.ok from HTTP package
2 parents c311f73 + 17de178 commit 3b3ea6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vulnerabilities/utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from collections import defaultdict
2020
from functools import total_ordering
2121
from hashlib import sha256
22+
from http import HTTPStatus
2223
from typing import List
2324
from typing import Optional
2425
from typing import Tuple
@@ -420,7 +421,7 @@ def fetch_response(url):
420421
Fetch and return `response` from the `url`
421422
"""
422423
response = requests.get(url)
423-
if response.status_code == 200:
424+
if response.status_code == HTTPStatus.OK:
424425
return response
425426
raise Exception(f"Failed to fetch data from {url!r} with status code: {response.status_code!r}")
426427

0 commit comments

Comments
 (0)