Skip to content

Commit 643c90a

Browse files
Sandbox URL Creation
1 parent e3f18bd commit 643c90a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ description = "The security toolkit for the Python community"
1313
keywords = ["security", "appsec"]
1414
dependencies = [
1515
"requests",
16+
"security==1.3.1",
1617
]
1718

1819
[project.urls]

src/security/safe_requests/api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
from urllib.parse import urlparse
22
from urllib.request import urlopen as unsafe_urlopen
3-
4-
from requests import get as unsafe_get
53
from requests import post as unsafe_post
64

75
from security.exceptions import SecurityException
86

97
from .host_validators import DefaultHostValidator
8+
from security import safe_requests
109

1110
DEFAULT_PROTOCOLS = frozenset(("http", "https"))
1211

@@ -58,7 +57,7 @@ def get(
5857
**kwargs,
5958
):
6059
UrlParser(url).check(allowed_protocols, host_validator)
61-
return unsafe_get(url, params=params, **kwargs)
60+
return safe_requests.get(url, params=params, **kwargs)
6261

6362

6463
def post(

0 commit comments

Comments
 (0)