fix: check_outbound_url crashes on a truthy non-string URL (#1623)

This commit is contained in:
Afonso Coutinho
2026-06-03 00:59:49 +01:00
committed by GitHub
parent 3175d7ca21
commit 03ddc5d2c4
2 changed files with 16 additions and 0 deletions
+2
View File
@@ -56,6 +56,8 @@ def check_outbound_url(
Returns ``(ok, reason)``. ``ok`` is True only when the URL is safe to fetch.
``resolver`` is injectable so callers/tests can avoid real DNS.
"""
if not isinstance(url, str):
return False, "URL must be a string"
if not url or not url.strip():
return False, "URL is required"
try: