Skip to content

Commit

Permalink
add accept
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXhh committed Apr 1, 2024
1 parent 35c93d1 commit c0504ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ export abstract class RegistryV2DataProvider extends CommonRegistryDataProvider
requestUri: requestUrl,
scopes: [`repository:${item.parent.label}:pull`],
headers: {
'accept': 'application/vnd.docker.distribution.manifest.v2+json,application/vnd.oci.image.index.v1+json'
// https://github.com/containerd/containerd/blob/main/core/remotes/docker/resolver.go#L163
'accept': 'application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*'
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ async function registryV2RequestInternal<T>(options: RegistryV2RequestOptions):

const request: RequestLike = {
headers: {
accept: 'application/json,application/vnd.oci.image.index.v1+json',
// https://github.com/containerd/containerd/blob/main/core/remotes/docker/resolver.go#L163
accept: 'application/json, application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*',
Authorization: `${auth.type} ${auth.accessToken}`,
...options.headers
},
Expand Down

0 comments on commit c0504ef

Please sign in to comment.