Skip to content

Commit fd1b013

Browse files
committed
Describe fallback behavior for monolithic uploads
Signed-off-by: Jon Johnson <[email protected]>
1 parent aeb5587 commit fd1b013

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spec.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ There are two ways to push a blob monolithically:
202202

203203
---
204204

205+
###### POST then PUT
206+
205207
To push a blob monolithically by using a POST request followed by a PUT request, there are two steps:
206208
1. Obtain a session id (upload URL)
207209
2. Upload the blob to said URL
@@ -246,6 +248,10 @@ With `<blob-location>` being a pullable blob URL.
246248

247249
---
248250

251+
###### Single POST
252+
253+
Registries MAY support pushing blobs using a single POST request.
254+
249255
To push a blob monolithically by using a single POST request, perform a `POST` request to a URL in the following form, and with the following headers and body:
250256

251257
`/v2/<name>/blobs/uploads/?digest=<digest>` <sup>[end-4b](#endpoints)</sup>
@@ -261,7 +267,9 @@ Here, `<name>` is the repository's namespace, `<digest>` is the blob's digest, a
261267

262268
The `Content-Length` header MUST match the blob's actual content length. Likewise, the `<digest>` MUST match the blob's digest.
263269

264-
Successful completion of the request MUST return either a `201 Created` or a `202 Accepted`, and MUST include the following header:
270+
Registries that do not support single request monolithic uploads SHOULD return a `202 Accepted` status code and `Location` header and clients SHOULD proceed with a subsequent PUT request, as described by the [POST then PUT upload method](#post-then-put).
271+
272+
Successful completion of the request MUST return a `201 Created` and MUST include the following header:
265273

266274
```
267275
Location: <blob-location>

0 commit comments

Comments
 (0)