Skip to content

Commit

Permalink
clarify where OCI-Chunk-Min-Length response headers are expected (#481)
Browse files Browse the repository at this point in the history
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í <mvdan@mvdan.cc>
  • Loading branch information
mvdan authored Nov 30, 2023
1 parent d2cca2f commit 9317d9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,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 `<size>` 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 `<size>` is the size in bytes (see the blob `PATCH` definition for usage):

```
OCI-Chunk-Min-Length: <size>
Expand Down Expand Up @@ -354,7 +354,7 @@ It MUST match the following regular expression:
```

The `<length>` 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:
Expand Down

0 comments on commit 9317d9b

Please sign in to comment.