Closed MikailBag closed 4 years ago
I've done some tests:
Accept:application/vnd.docker.distribution.manifest.v2+json;q=0.5,application/vnd.docker.distribution.manifest.v1+prettyjws; charset=utf-8; q=0.4
: produces error as above.
Accept:application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+prettyjws; charset=utf-8; q=0.4
: works (successfully returns manifest).
(Second Accept
string has q=0.5
portion removed).
I used httpie
for experiments.
From this information I believe that Google Container Registry parses Accept
header literally, splitting it by ,
. It does not strip q
parameter. So it observes that "application/vnd.docker.distribution.manifest.v2+json;q=1"!="application/vnd.docker.distribution.manifest.v2+json"
and returns error.
I will try to investigate if passing q
parameter is allowed by Docker Registry API.
I just had a play with this and it seems like skipping the q
key is enough to make GCR happy. The following works here:
http --verbose 'https://gcr.io/v2/jjs-dev/jjs-apiserver/manifests/latest' 'Accept:application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+prettyjws; charset=utf-8'
I also tried with just the ...v1+prettyjws
type and it fails, so I recognize that they only support the v2+json
at this time. I'd be in favor in baking these kind of workarounds into dkregistry over making the headers overridable as #162.
get_manifest
fails, because GCR returns error 404. Response body isI am not sure if I right, but it seems like incorrect parsing of
Accept
HTTP header on GCR side. What do you think?