Skip to content

Commit 3b3f87c

Browse files
committed
Make URL secrets removal more resilient
1 parent 27fac52 commit 3b3f87c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dispatcher/backend/src/routes/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ def remove_url_secrets(response: dict):
103103
if not isinstance(response[key], str) or "://" not in response[key]:
104104
continue
105105
for url in [word for word in response[key].split() if "://" in word]:
106-
urlparts = urlsplit(url)
106+
try:
107+
urlparts = urlsplit(url)
108+
except Exception as exc:
109+
logger.warning(
110+
f"Ignoring bad URL in remove_url_secrets: {url}", exc_info=exc
111+
)
112+
continue
107113
newquery = urlencode(
108114
{
109115
key: (

0 commit comments

Comments
 (0)