opencontainers / distribution-spec

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

spec: PUT /v2/<name>/manifests/<reference> MUST include Content-Type #477

Closed waynr closed 4 months ago

waynr commented 1 year ago

This came up in discussion on the CNCF slack's #distribution channel:

The basic issue is that there is an ambiguity in the spec as-written where it's not clear what the behavior should be if neither the manifest includes a mediaType field (since that is optional) nor the PUT request includes a content-type header.

With this change from SHOULD to MUST it's clearer that registries should return an error if there is no Content-Type header.

If there are registries out there that don't enforce this and consequently there are potential clients that don't include it already then it shouldn't be difficult for those clients to issue a bug fix if they really need to be used to push to a more strict registry.

sudo-bmitch commented 1 year ago

This needs a signoff to pass the DCO check.

I'm leaning towards approving it, but I'd like to first check if the major registries already require it, or that no major clients are missing the header (the former would be a better check).

sudo-bmitch commented 4 months ago

We brought this up in today's call and it got a NACK from several maintainers. Registries can enforce this since it's a SHOULD today, and clients SHOULD include it and expect errors if they do not.