File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -151,16 +151,16 @@ async def async_request(
151151 except httpx .RequestError as exc :
152152 last_exc = exc
153153 if attempt >= retries :
154- if not _is_sensitive_url (url ):
155- log_url = _redact_sensitive_url_params (url )
156- logger .warning (f"async_request exhausted retries for { method } { log_url } " )
157- raise
158- delay = _get_delay (backoff_factor , attempt )
159- if not _is_sensitive_url (url ):
160- log_url = _redact_sensitive_url_params (url )
154+ # Do not log the full URL here to avoid leaking sensitive data.
161155 logger .warning (
162- f"async_request attempt { attempt + 1 } / { retries + 1 } failed for { method } { log_url } ; retrying in { delay :.2f } s "
156+ f"async_request exhausted retries for { method } ; last error: { exc } "
163157 )
158+ raise
159+ delay = _get_delay (backoff_factor , attempt )
160+ # Avoid including the (potentially sensitive) URL in retry logs.
161+ logger .warning (
162+ f"async_request attempt { attempt + 1 } /{ retries + 1 } failed for { method } ; retrying in { delay :.2f} s"
163+ )
164164 await asyncio .sleep (delay )
165165 raise last_exc # pragma: no cover
166166
You can’t perform that action at this time.
0 commit comments