Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conformance Test: 'Accept' header set during manifest put #396

Closed
Dylmay opened this issue Mar 30, 2023 · 3 comments · Fixed by #400
Closed

Conformance Test: 'Accept' header set during manifest put #396

Dylmay opened this issue Mar 30, 2023 · 3 comments · Fixed by #400

Comments

@Dylmay
Copy link

Dylmay commented Mar 30, 2023

Within the OCI spec there is no mention of the 'Accept' header being set during put operations. Is it expected behaviour to have the Accept header set to 'application/vnd.oci.image.manifest.v1+json'?

The server I am currently testing will return 406 due to the endpoint not producing 'application/vnd.oci.image.manifest.v1+json', only 'application/json', and the server is responding strictly to the request.

Can you provide clarification on whether the conformance test is incorrectly setting this header or whether the server should be expected to produce 'application/vnd.oci.image.manifest.v1+json'.

Note:

The header isn't being set by the conformance test explicitly but the underlying resty client is setting it here.

Request:

~~~ REQUEST ~~~
PUT  /v2/test-img-name/manifests/tagtest0  HTTP/1.1
HEADERS:
	Accept: application/vnd.oci.image.manifest.v1+json
	Content-Type: application/vnd.oci.image.manifest.v1+json
	User-Agent: distribution-spec-conformance-tests
~~~ RESPONSE ~~~
STATUS       : 406 Not Acceptable
@sudo-bmitch
Copy link
Contributor

It's not something I think we want to check in tests, and I'd expect the response to a PUT to be different from the body of the request. That makes me think it's a bug in resty.

@sudo-bmitch
Copy link
Contributor

@jdolitsky PTAL

@jdolitsky
Copy link
Member

Looks like something we may be able to fix using SetPreRequestHook https://github.com/go-resty/resty/blob/cf2d4c4212b78f4b4848afe74d89a73e5980f769/client.go#L549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants