From 4c6003810a5c31f510970af46bfc7acda9a8b794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 13 Oct 2023 11:49:34 +0100 Subject: [PATCH] clarify where OCI-Chunk-Min-Length response headers are expected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first section speaks about a chunked upload with three stages of HTTP requests (POST, PATCH, PUT), so the wording "the response" is ambiguous as to which one of the three requests it's for. The conformance tests seem to imply POST, and that is what makes the most sense to me - if the server only gives the minimum after the first PATCH or PUT, the client might have already written chunks which are too small without realising. Another bit of the spec talks about the same header, but refers explicitly to the PUT response of a chunked upload. This again doesn't feel right: I think POST was meant instead. Giving the minimum as part of the final PUT response is pointless, since the client isn't writing any more chunks after that point. Signed-off-by: Daniel Martí --- spec.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.md b/spec.md index 5f6f1cfa..53a9dc18 100644 --- a/spec.md +++ b/spec.md @@ -319,7 +319,7 @@ The process remains unchanged for chunked upload, except that the post request M Content-Length: 0 ``` -If the registry has a minimum chunk size, the response SHOULD include the following header, where `` is the size in bytes (see the blob `PATCH` definition for usage): +If the registry has a minimum chunk size, the `POST` response SHOULD include the following header, where `` is the size in bytes (see the blob `PATCH` definition for usage): ``` OCI-Chunk-Min-Length: @@ -351,7 +351,7 @@ It MUST match the following regular expression: ``` The `` is the content-length, in bytes, of the current chunk. -If the registry provides a `OCI-Chunk-Min-Length` header in the `PUT` response, the size of each chunk, except for the final chunk, SHOULD be greater or equal to that value. +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: