Give /v1/e/ ETag, 304 and HEAD as /v1/image/ has (closes #84)
check / check (push) Waiting to run
check / check (push) Waiting to run
The ETag and If-None-Match code of the /v1/image/ handler becomes notModified, which both image handlers call; /v1/e/ answers HEAD with the headers only and is routed for HEAD. HandleImageEnc was at the 80-line function limit, so its token checks move unchanged into parseImageEncRequest, as parseImageRequest does for /v1/image/. No Vary is added: only the image routes' CORS headers depend on a request header, and go-chi/cors already sends Vary: Origin with them. Model: opus-5-5
This commit is contained in:
@@ -29,6 +29,19 @@ P2: security: referer blacklist
|
||||
|
||||
# Completed Steps
|
||||
|
||||
- 2026-10-04 request IDs returned and passed on, and `/v1/e/` revalidates
|
||||
(closes #84): a middleware right after chi's `RequestID` sets `X-Request-ID`
|
||||
on every response from the ID `RequestID` stores in the request context, which
|
||||
is the request's own `X-Request-ID` when it sent one; the upstream fetch sends
|
||||
that ID, and the "upstream fetched", "image converted" and "image served" log
|
||||
lines carry it as `request_id`, a fetch shared by several requests carrying
|
||||
the first request's; `/v1/e/` sets `ETag`, answers a matching `If-None-Match`
|
||||
with 304 and is routed for `HEAD`, the `ETag` and 304 code being
|
||||
`notModified`, which `/v1/image/` calls too; its token checks moved unchanged
|
||||
into `parseImageEncRequest` to keep `HandleImageEnc` within the line limit; no
|
||||
`Vary` is added, as no response depends on a request header except the image
|
||||
routes' CORS headers, for which `go-chi/cors` already sends `Vary: Origin`;
|
||||
`Vary: Accept` is left to #88.
|
||||
- 2026-10-04 routes, encrypted URLs and config file documented (closes #75):
|
||||
"Routes" in `README.md` lists every route with its method, purpose, what it
|
||||
needs and the status codes it answers with, and says `q` and `fit` are part
|
||||
@@ -438,7 +451,6 @@ P2: security: referer blacklist
|
||||
- P2: HTTP response handling
|
||||
- Last-Modified headers
|
||||
- Vary header for content negotiation
|
||||
- X-Request-ID propagation
|
||||
- P2: auto format selection (format=auto based on Accept header)
|
||||
- P2: configuration
|
||||
- YAML config file support
|
||||
|
||||
Reference in New Issue
Block a user