From ea3cc3476a4ee826fd7fb1b14badb1007dce6d65 Mon Sep 17 00:00:00 2001 From: "pixeebot[bot]" <104101892+pixeebot[bot]@users.noreply.github.com> Date: Sun, 3 Nov 2024 03:15:13 +0000 Subject: [PATCH] Sandbox URL Creation --- pyproject.toml | 1 + src/security/safe_requests/api.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) 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(