Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Conversation

@malancas
Copy link
Contributor

Part of https://github.com/github/package-security/issues/1731

Use a custom transport to handle non-compliant 406 responses from APIs when attempting to reach the refferes. endpoint. If an API does not support the referrers API, we generally expect a 404 response, but we have seen a 406 response as well and want to handle that case.

Signed-off-by: Meredith Lancaster <malancas@github.com>
@malancas malancas requested review from a team and steiza as code owners June 18, 2024 19:47

type noncompliantRegistryTransport struct{}

func (a *noncompliantRegistryTransport) RoundTrip(req *http.Request) (*http.Response, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment to explain why this is needed. Also would be good to include a link to a go-containerregistry issue if we are reporting this as a bug there (since this hack can be removed if go-containerregistry can handle the this unexpected header).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have an issue filed yet but can add a link once I file one.

malancas added 3 commits June 18, 2024 13:53
Signed-off-by: Meredith Lancaster <malancas@github.com>
Signed-off-by: Meredith Lancaster <malancas@github.com>
Signed-off-by: Meredith Lancaster <malancas@github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants