Skip to content

Commit ec90a2a

Browse files
authored
Merge pull request from GHSA-mc8v-mgrf-8f4m
spec: clarify handling regarding Content-type header
2 parents b3f631f + 158fd47 commit ec90a2a

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

spec.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ Throughout this document, `<reference>` as a tag MUST be at most 128 characters
146146

147147
The client SHOULD include an `Accept` header indicating which manifest content types it supports.
148148
In a successful response, the `Content-Type` header will indicate the type of the returned manifest.
149-
For more information on the use of `Accept` headers and content negotiation, please see [Content Negotiation](./content-negotiation.md)
149+
The `Content-Type` header SHOULD match what the client [pushed as the manifest's `Content-Type`](#pushing-manifests).
150+
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.
151+
For more information on the use of `Accept` headers and content negotiation, please see [Content Negotiation](./content-negotiation.md).
150152

151153
A GET request to an existing manifest URL MUST provide the expected manifest, with a response code that MUST be `200 OK`.
152154
A successful response SHOULD contain the digest of the uploaded blob in the header `Docker-Content-Digest`.
@@ -386,11 +388,20 @@ it SHOULD return a `202`. This indicates that the upload session has begun and t
386388
To push a manifest, perform a `PUT` request to a path in the following format, and with the following headers
387389
and body:
388390
`/v2/<name>/manifests/<reference>` <sup>[end-7](#endpoints)</sup>
391+
392+
Clients SHOULD set the `Content-Type` header to the type of the manifest being pushed.
393+
All manifests SHOULD include a `mediaType` field declaring the type of the manifest being pushed.
394+
If a manifest includes a `mediaType` field, clients MUST set the `Content-Type` header to the value specified by the `mediaType` field.
395+
389396
```
390397
Content-Type: application/vnd.oci.image.manifest.v1+json
391398
```
399+
Manifest byte stream:
392400
```
393-
<manifest byte stream>
401+
{
402+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
403+
...
404+
}
394405
```
395406

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

specs-go/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
// VersionMinor is for functionality in a backwards-compatible manner
2323
VersionMinor = 0
2424
// VersionPatch is for backwards-compatible bug fixes
25-
VersionPatch = 0
25+
VersionPatch = 1
2626

2727
// VersionDev indicates development branch. Releases will be empty string.
2828
VersionDev = "-dev"

0 commit comments

Comments
 (0)