1
0
mirror of https://github.com/opencontainers/distribution-spec.git synced 2026-02-05 09:45:54 +01:00

Clarify the Range header on a chunked push response

This clarifies the Range header response should be the range of the entire blob and not the last received chunk.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
This commit is contained in:
Brandon Mitchell
2025-07-10 14:34:19 -04:00
parent 9d1b92567f
commit d9f703cfc1
3 changed files with 5 additions and 4 deletions

View File

@@ -92,7 +92,7 @@ conformance-test:
conformance-binary: $(OUTPUT_DIRNAME)/conformance.test
TEST_REGISTRY_CONTAINER ?= ghcr.io/project-zot/zot-minimal-linux-amd64:v2.0.4@sha256:0312c23d9658b912a0d4db5c6ecd6d4391c1211912f10de3e9a52685f000318a
TEST_REGISTRY_CONTAINER ?= ghcr.io/project-zot/zot-minimal-linux-amd64:v2.1.7@sha256:2114797f00696011f38cc94c72f5773c84b1036562df5034d05ea19075179ad1
registry-ci:
docker rm -f oci-conformance && \
mkdir -p $(OUTPUT_DIRNAME) && \

View File

@@ -237,6 +237,7 @@ var test02Push = func() {
Expect(err).To(BeNil())
location := resp.Header().Get("Location")
Expect(resp.StatusCode()).To(Equal(http.StatusAccepted))
Expect(resp.Header().Get("Range")).To(Equal(fmt.Sprintf("0-%d", len(testBlobB)-1)))
Expect(location).ToNot(BeEmpty())
lastResponse = resp
})

View File

@@ -368,7 +368,7 @@ The `<length>` is the content-length, in bytes, of the current chunk.
If the registry provides an `OCI-Chunk-Min-Length` header in the `POST` response, the size of each chunk, except for the final chunk, SHOULD be greater or equal to that value.
The final chunk MAY have any length.
Each successful chunk upload MUST have a `202 Accepted` response code, and MUST have the following headers:
The response for each successful chunk upload MUST be `202 Accepted`, and MUST have the following headers:
```
Location: <location>
@@ -377,7 +377,7 @@ Range: 0-<end-of-range>
Each consecutive chunk upload SHOULD use the `<location>` provided in the response to the previous chunk upload.
The `<end-of-range>` value is the position of the last uploaded byte.
The `<end-of-range>` value is the position of the last uploaded byte of the blob, matching the end value of the `Content-Range` in the request.
Chunks MUST be uploaded in order, with the first byte of a chunk being the last chunk's `<end-of-range>` plus one.
If a chunk is uploaded out of order, the registry MUST respond with a `416 Requested Range Not Satisfiable` code.
@@ -424,7 +424,7 @@ Range: 0-<end-of-range>
The following chunk upload SHOULD use the `<location>` provided in the response.
The `<end-of-range>` value is the position of the last uploaded byte.
The `<end-of-range>` value is the position of the last uploaded byte of the blob.
##### Mounting a blob from another repository