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

Merged

Conversation

malancas
Copy link
Contributor

@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>
@imjasonh imjasonh enabled auto-merge (squash) October 28, 2024 17:13
@imjasonh imjasonh merged commit a9a53a8 into google:main Oct 28, 2024
15 of 18 checks passed
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.

2 participants