Skip to content

Commit ac28cac

Browse files
committed
spec: clarify handling regarding Content-type header
Signed-off-by: Vincent Batts <[email protected]>
1 parent 13bd083 commit ac28cac

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

spec.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ The `<reference>` MUST NOT be in any other format. Throughout this document, `<n
142142

143143
The client SHOULD include an `Accept` header indicating which manifest content types it supports.
144144
In a successful response, the `Content-Type` header will indicate the type of the returned manifest.
145-
For more information on the use of `Accept` headers and content negotiation, please see [Content Negotiation](./content-negotiation.md)
145+
The `Content-Type` header SHOULD match what the client [pushed as the manifest's `Content-Type`](#pushing-manifests).
146+
If the manifest has a `mediaType` field, clients SHOULD reject unless the `mediaType` field's value matches the type specified by the `Content-Type` header.
147+
For more information on the use of `Accept` headers and content negotiation, please see [Content Negotiation](./content-negotiation.md).
146148

147149
A GET request to an existing manifest URL MUST provide the expected manifest, with a response code that MUST be `200 OK`.
148150
A successful response SHOULD contain the digest of the uploaded blob in the header `Docker-Content-Digest`.
@@ -380,11 +382,20 @@ it SHOULD return a `202`. This indicates that the upload session has begun and t
380382
To push a manifest, perform a `PUT` request to a path in the following format, and with the following headers
381383
and body:
382384
`/v2/<name>/manifests/<reference>` <sup>[end-7](#endpoints)</sup>
385+
386+
Clients SHOULD set the `Content-Type` header to the type of the manifest being pushed.
387+
All manifests SHOULD include a `mediaType` field declaring the type of the manifest being pushed.
388+
If a manifest includes a `mediaType` field, clients MUST set the `Content-Type` header to the value specified by the `mediaType` field.
389+
383390
```
384391
Content-Type: application/vnd.oci.image.manifest.v1+json
385392
```
393+
Manifest byte stream:
386394
```
387-
<manifest byte stream>
395+
{
396+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
397+
...
398+
}
388399
```
389400

390401
`<name>` is the namespace of the repository, and the `<reference>` MUST be either a) a digest or b) a tag.

0 commit comments

Comments
 (0)