opencontainers / distribution-spec

OCI Distribution Specification
https://opencontainers.org
Apache License 2.0
792 stars 199 forks source link

Clarify chunked-upload GET request #414

Closed rogpeppe closed 1 year ago

rogpeppe commented 1 year ago

The spec says:

Chunks MUST be uploaded in order, with the first byte of a chunk being the last chunk's plus one. If a chunk is uploaded out of order, the registry MUST respond with a 416 Requested Range Not Satisfiable code. A GET request may be used to retrieve the current valid offset and upload location.

That last sentence is curiously underspecified. I'm guessing that the GET request is to the same location as the previous returned Location, but it doesn't say how the information is returned. What is the expected status code for the GET request? Is the information be encoded in the headers as with a PATCH response? It would be good to be explicit about these things.

(Aside: I wonder if anyone considered returning the range information in the 416 response headers, to avoid an extra round-trip in this scenario).

rogpeppe commented 1 year ago

I just read a bit further down and found the "To get the current status after a 416 error" section. Perhaps the " A GET request may be used to retrieve the current valid offset and upload location." sentence could be qualified with "see below" to make it a bit more obvious?