Log the full image_url in the access line

url_host alone made cross-referencing a failed fetch with the caller's
request awkward. Log the full URL too (truncated to 512 chars). Presigned
URLs do land their query-string token in the log -- acceptable for trusted
callers writing to a private log; drop the query if that assumption changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 06:32:58 +00:00
parent 258e0fcf6e
commit 3a8a1ef38a
+4
View File
@@ -422,6 +422,10 @@ async def remove_background(
log["source"] = "url" if url else "file"
if url:
log["url_host"] = urlparse(url).hostname or "-"
# Full URL for debugging. NOTE: presigned URLs put their auth token in
# the query string, so this lands credentials in the log -- acceptable
# here (trusted callers, private log); drop the query if that changes.
log["url"] = url[:512]
log["seg_model"] = normalized_seg
log["cross_check"] = "on" if effective_cc else "off"
log["background_mode"] = effective_bg