Skip to content

Commit 570d026

Browse files
authored
Merge pull request from GHSA-mc8v-mgrf-8f4m
Advisory fix 2
2 parents 13bd083 + 5d83a35 commit 570d026

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

spec.md

Lines changed: 13 additions & 2 deletions
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.

specs-go/version.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ 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.
28-
VersionDev = ""
28+
VersionDev = "-dev"
2929
)
3030

3131
// Version is the specification version that the package types support.

0 commit comments

Comments
 (0)