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

Check for 406 status code when handling referrers API endpoint response #2026

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

malancas
Copy link

@malancas malancas commented Oct 17, 2024

While using the remote.Referrers function with the Artifactory registry, I found the function was unexpectedly failing. Digging into the error, I found the registry was returning a 406 instead of a 404 when the remote.Referrers function attempted to make a request to the referrers endpoint. Adding http.StatusNotAcceptable to the list of handled status codes in transport.CheckError fixed the problem for me.

This PR adds http.StatusNotAcceptable to the list of status codes handled by transport.CheckError. Since it is a 4XX error, remote.Referrers is able to fallback and try the manifests API endpoint.

I had filed #1962 asking about this change but realized the change is small enough a pull request might be easier.

Signed-off-by: Meredith Lancaster <malancas@github.com>
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 this pull request may close these issues.

1 participant