Skip to content

Commit

Permalink
fix: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aht007 committed Dec 13, 2024
1 parent 1d98251 commit df9f9cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commerce_coordinator/apps/paypal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def _get_certificate(self, url):
"""
Get certificate from the given URL
"""
if not self._is_valid_url(url):
raise ValueError("Invalid or untrusted URL provided")
try:
if not self._is_valid_url(url):
raise ValueError("Invalid or untrusted URL provided") from e
cache = KeyValueCache.objects.get(cache_key=url)
return cache.value
except Exception as e: # pylint: disable=broad-exception-caught
except KeyValueCache.DoesNotExist:
r = requests.get(url) # pylint: disable=missing-timeout

Check failure

Code scanning / CodeQL

Full server-side request forgery Critical

The full URL of this request depends on a
user-provided value
.
KeyValueCache.objects.create(cache_key=url, cache_value=r.text)
return r.text
Expand Down

0 comments on commit df9f9cc

Please sign in to comment.