Skip to content

Commit a668365

Browse files
authored
Merge pull request #3696 from dmcgowan/fix-all-media-types
Fix all media types in Accept header to match RFC
2 parents 524f81d + 394db03 commit a668365

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

remotes/docker/fetcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.R
136136
}
137137

138138
func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, offset int64) (io.ReadCloser, error) {
139-
req.header.Set("Accept", strings.Join([]string{mediatype, `*`}, ", "))
139+
req.header.Set("Accept", strings.Join([]string{mediatype, `*/*`}, ", "))
140140

141141
if offset > 0 {
142142
// Note: "Accept-Ranges: bytes" cannot be trusted as some endpoints

remotes/docker/pusher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (conten
8080
}
8181

8282
req := p.request(host, http.MethodHead, existCheck...)
83-
req.header.Set("Accept", strings.Join([]string{desc.MediaType, `*`}, ", "))
83+
req.header.Set("Accept", strings.Join([]string{desc.MediaType, `*/*`}, ", "))
8484

8585
log.G(ctx).WithField("url", req.String()).Debugf("checking and pushing to")
8686

remotes/docker/resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func NewResolver(options ResolverOptions) remotes.Resolver {
155155
images.MediaTypeDockerSchema2Manifest,
156156
images.MediaTypeDockerSchema2ManifestList,
157157
ocispec.MediaTypeImageManifest,
158-
ocispec.MediaTypeImageIndex, "*"}, ", "))
158+
ocispec.MediaTypeImageIndex, "*/*"}, ", "))
159159
} else {
160160
resolveHeader["Accept"] = options.Headers["Accept"]
161161
delete(options.Headers, "Accept")

0 commit comments

Comments
 (0)