mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
1a1f84d1843fedc22cc63ac6e9f62aba3c4466a1
* fix(api): set blob response Content-Type from OCI descriptor Blob HEAD responses had no Content-Type and GET responses echoed the request's Accept header verbatim, which produced missing or malformed media types and left multipart/byteranges parts without a per-part Content-Type. This breaks OCI distribution-spec conformance and consumers like stargz-snapshotter that need a well-formed layer media type. Add a blobResponseMediaType helper that resolves the descriptor's MediaType via GetBlobDescriptorFromRepo and falls back to application/octet-stream. Use it in CheckBlob (HEAD), GetBlob full (200), GetBlob single-range (206), and per-part in writeMultipartRanges (206 multipart). Lookup is deferred until after the blob is known to exist. Cover the new behaviour with mock-based unit tests in routes_test.go and end-to-end assertions in TestPullRange. Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com> * perf(api): stream multipart blob ranges lazily with precomputed Content-Length writeMultipartRanges previously opened every range reader up front and emitted no Content-Length, so an N-range request held N concurrent storage readers (and their fds / read buffers) per response window and forced chunked encoding on HTTP/1.1 — neither friendly to proxies nor to fan-out scenarios like stargz lazy pulls. Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com> --------- Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
zot
zot: a production-ready vendor-neutral OCI image registry - images stored in OCI image format, distribution specification on-the-wire, that's it!
Documentation for zot is located at: https://zotregistry.dev
Code of conduct details are here.
License
Description
Languages
Go
93.6%
Shell
5.8%
Makefile
0.4%