fix: HEAD requests fetch and stream the full body #89
Reference in New Issue
Block a user
Delete Branch "benvin/head-metadata-only"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #70
Why
Docker
HEADroutes mapped tohandleProxy, which ran a fullFetch+io.Copy— downloading the entire blob (and fetching upstream on a miss) only for net/http to discard the body. HEAD existence checks (manifests, blobs) are common.Changes
Engine.Head: answers cached artifacts/indexes from store metadata (no blob download); on a miss issues an upstreamHEAD(with bearer-token handling) and never caches a body.HEAD /v2/{remote}/*to a dedicatedhandleProxyHeadthat writes headers only.Note
headUpstreamuseshttp.DefaultClientto build cleanly on master; it will pick up the shared timeout-configured client from #67 once that merges.Validation
make e2epasses (includes new HEAD tests).