Skip to content

Make clip GET metadata match the file that is actually served #8

Description

@Luqueee

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions