Problem
In internal/clip/server.go:147-173, handleLatest stats the cache path before opening it.
An atomic replacement between Stat and Open can make Content-Length and Last-Modified describe a different inode from the bytes sent to the client.
Acceptance criteria
- Open the file first and obtain metadata from the opened file handle.
- Keep 404 behavior for a missing cache.
- Ensure headers and response body describe the same image.
- Add a concurrent PUT/GET regression test.
Problem
In internal/clip/server.go:147-173, handleLatest stats the cache path before opening it.
An atomic replacement between Stat and Open can make Content-Length and Last-Modified describe a different inode from the bytes sent to the client.
Acceptance criteria