Skip to content

Commit

Permalink
Sandbox URL Creation
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeebot[bot] authored Aug 3, 2024
1 parent e3f18bd commit 1680186
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ description = "The security toolkit for the Python community"
keywords = ["security", "appsec"]
dependencies = [
"requests",
"security==1.3.1",
]

[project.urls]
5 changes: 2 additions & 3 deletions src/security/safe_requests/api.py
Original file line number Diff line number Diff line change
@@ -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(

0 comments on commit 1680186

Please sign in to comment.