Skip to content

Commit d9f703c

Browse files
committed
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 <[email protected]>
1 parent 9d1b925 commit d9f703c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ conformance-test:
9292

9393
conformance-binary: $(OUTPUT_DIRNAME)/conformance.test
9494

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

conformance/02_push_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ var test02Push = func() {
237237
Expect(err).To(BeNil())
238238
location := resp.Header().Get("Location")
239239
Expect(resp.StatusCode()).To(Equal(http.StatusAccepted))
240+
Expect(resp.Header().Get("Range")).To(Equal(fmt.Sprintf("0-%d", len(testBlobB)-1)))
240241
Expect(location).ToNot(BeEmpty())
241242
lastResponse = resp
242243
})

spec.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ The `<length>` is the content-length, in bytes, of the current chunk.
368368
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.
369369
The final chunk MAY have any length.
370370

371-
Each successful chunk upload MUST have a `202 Accepted` response code, and MUST have the following headers:
371+
The response for each successful chunk upload MUST be `202 Accepted`, and MUST have the following headers:
372372

373373
```
374374
Location: <location>
@@ -377,7 +377,7 @@ Range: 0-<end-of-range>
377377

378378
Each consecutive chunk upload SHOULD use the `<location>` provided in the response to the previous chunk upload.
379379

380-
The `<end-of-range>` value is the position of the last uploaded byte.
380+
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.
381381

382382
Chunks MUST be uploaded in order, with the first byte of a chunk being the last chunk's `<end-of-range>` plus one.
383383
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>
424424

425425
The following chunk upload SHOULD use the `<location>` provided in the response.
426426

427-
The `<end-of-range>` value is the position of the last uploaded byte.
427+
The `<end-of-range>` value is the position of the last uploaded byte of the blob.
428428

429429
##### Mounting a blob from another repository
430430

0 commit comments

Comments
 (0)