Give /v1/e/ ETag, 304 and HEAD as /v1/image/ has (closes #84)
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:
2026-10-04 08:40:15 +00:00
parent 20a46e96a2
commit f507b6076d
5 changed files with 101 additions and 51 deletions
+1
View File
@@ -98,6 +98,7 @@ func (s *Server) SetupRoutes() {
// The trailing filename (e.g., /img.jpg) is ignored but helps
// browsers with content type
r.Get("/e/{token}/*", s.h.HandleImageEnc())
r.Head("/e/{token}/*", s.h.HandleImageEnc())
})
})