diff --git a/pyproject.toml b/pyproject.toml index 345b61e..91030eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ description = "The security toolkit for the Python community" keywords = ["security", "appsec"] dependencies = [ "requests", + "security==1.3.1", ] [project.urls] diff --git a/src/security/safe_requests/api.py b/src/security/safe_requests/api.py index 826e1a2..c45ab44 100644 --- a/src/security/safe_requests/api.py +++ b/src/security/safe_requests/api.py @@ -1,12 +1,11 @@ from urllib.parse import urlparse from urllib.request import urlopen as unsafe_urlopen - -from requests import get as unsafe_get from requests import post as unsafe_post from security.exceptions import SecurityException from .host_validators import DefaultHostValidator +from security import safe_requests DEFAULT_PROTOCOLS = frozenset(("http", "https")) @@ -58,7 +57,7 @@ def get( **kwargs, ): UrlParser(url).check(allowed_protocols, host_validator) - return unsafe_get(url, params=params, **kwargs) + return safe_requests.get(url, params=params, **kwargs) def post(