Answer 499 to an image request whose client went away (closes #339)
check / check (push) Canceled after 0s

When the client of an image request goes away before its image is
ready, the image proxy returns context.Canceled. serveImage now logs
this once at info level, with the request_id, host and path, and
answers 499, the status nginx calls "client closed request". It was
answered 500 and logged at error level, as pixa's own failure. The
check sits in serveImage, before respondImageError, which cannot see
the request's context. A cancellation while the request's context is
live is still answered 500. README.md lists the 499 on both image
routes.

Model: opus-5-5
This commit is contained in:
2026-10-26 22:31:56 +00:00
parent 6de69f7349
commit dc71ed125b
4 changed files with 209 additions and 2 deletions
+2
View File
@@ -310,6 +310,7 @@ path under `/v1/` answers 200, in maintenance mode too.
- 403 when the upstream host, or a host it redirects to, has an address in a
blocked network (see `blocked_networks`).
- 429 over `image_requests_per_minute` (below).
- 499 when the client goes away before the image is ready.
- 415 when the upstream answers with a `Content-Type` that is not one of the
source formats (below).
- 415 when the upstream sends a body whose first bytes are not those of the
@@ -341,6 +342,7 @@ path under `/v1/` answers 200, in maintenance mode too.
- 403
- 415
- 429
- 499
- 502
- 503
- 504