Skip to content

Commit e7ed8af

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 583e014 commit e7ed8af

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.

0 commit comments

Comments
 (0)