From 3a8a1ef38a8df35a53feb16b225167f5efb65155 Mon Sep 17 00:00:00 2001 From: Linghong Date: Fri, 17 Jul 2026 06:32:58 +0000 Subject: [PATCH] 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 --- app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.py b/app.py index fbea29e..a94a4c2 100644 --- a/app.py +++ b/app.py @@ -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