Skip to content

Commit

Permalink
Merge pull request #1019 from openzim/remove_secrets
Browse files Browse the repository at this point in the history
Make URL secrets removal more resilient
  • Loading branch information
benoit74 authored Sep 20, 2024
2 parents 27fac52 + 3b3f87c commit 72481c2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dispatcher/backend/src/routes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ def remove_url_secrets(response: dict):
if not isinstance(response[key], str) or "://" not in response[key]:
continue
for url in [word for word in response[key].split() if "://" in word]:
urlparts = urlsplit(url)
try:
urlparts = urlsplit(url)
except Exception as exc:
logger.warning(
f"Ignoring bad URL in remove_url_secrets: {url}", exc_info=exc
)
continue
newquery = urlencode(
{
key: (
Expand Down

0 comments on commit 72481c2

Please sign in to comment.