opencontainers/distribution-spec

Relax the `Content-Type` header check in `conformance /03_discovery_test`

northtyphoon opened this issue · 4 comments

The following validation requires the server return Content-Type header application/vnd.oci.image.index.v1+json exactly. If the server returns application/vnd.oci.image.index.v1+json; charset=utf-8, it would fail. Can the test relax the validation to allow the additional charset parameter?

Expect(resp.Header().Get("Content-Type")).To(Equal("application/vnd.oci.image.index.v1+json"))

Expect(resp.Header().Get("Content-Type")).To(Equal("application/vnd.oci.image.index.v1+json"))

Expect(resp.Header().Get("Content-Type")).To(Equal("application/vnd.oci.image.index.v1+json"))

This gets into #408, which I'm having a hard time telling if there's a consensus on. Our spec for the header currently says:

The Content-Type header MUST be set to application/vnd.oci.image.index.v1+json.

Thanks for the clarification. I assume 1.1 spec will stick to MUST?

The referrers API was added in 1.1, and these tests are part of the RC for 1.1. So now it's the last chance to sort these things out before it gets released.

We adjusted our implementation to follow the spec “MUST”. Thanks for the clarification again.