mirror of
https://github.com/project-zot/zot.git
synced 2026-06-15 11:37:56 +08:00
9ba59559d2f4bf2502e7fb4efa120e5558ee7bb6
Align closing blob upload (PUT) with the OCI Distribution Spec: invalid / out-of-order upload ranges (ErrBadUploadRange) return 416 Requested Range Not Satisfiable instead of 400, for both the final-chunk PutBlobChunk path and FinishBlobUpload. GetBlobUpload (GET upload status): fix the Range response when zero bytes have been received—send Range: 0-0 instead of Range: 0--1, consistent with a new session and the spec’s Location + Range upload status shape. Only map ErrBadBlobDigest to 400 here; do not handle ErrBadUploadRange on GET (that request carries no range; ImageStore.GetBlobUpload does not return it). Document PUT upload failures 400 and 416 in swagger; regenerate swagger artifacts. Update route tests (expect 416 on UpdateBlobUpload for ErrBadUploadRange), drop the mock-only GetBlobUpload+ErrBadUploadRange case, and assert Range: 0-0 in TestPullRange after GET on a new upload location. Fix potential panic when parsing Content-Range (index out of range) when accessing `tokens[0]`. 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%
Shell
6.4%
Makefile
0.4%