fix: don't crash on invalid URLs in HTML (#755)

Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
This commit is contained in:
Timothée Mazzucotelli
2026-06-19 11:03:49 +00:00
committed by GitHub
parent e6b55fe6c6
commit 909f97368c
+4 -1
View File
@@ -191,7 +191,10 @@ def _is_relative(value: str) -> bool:
return False
# Absolute URLs (e.g. `https://example.com`) and protocol-relative URLs
url = urlparse(value)
try:
url = urlparse(value)
except ValueError:
return False
if url.scheme or url.netloc or url.path.startswith("/"):
return False