1
0
mirror of https://github.com/docker/cli.git synced 2026-01-13 18:22:35 +03:00

distribution: Add text/html and application/json as image mediatypes

As noted by #30083, the new strict checking of mediatypes misses some
cases where earlier bugs caused nonstandard mediatypes to be stored in
manifests. Two of the known cases are text/html and application/json,
which were returned by certain registries and stored by earlier versions
of Docker. Add special cases for text/html and application/json.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: a215e15cb1fbecc3b22d4f90e15638728ac7ac78
Component: engine
This commit is contained in:
Aaron Lehmann
2017-01-18 18:19:12 -08:00
parent ae5b65a856
commit c4cc189597

View File

@@ -23,7 +23,11 @@ import (
var ImageTypes = []string{
schema2.MediaTypeImageConfig,
// Handle unexpected values from https://github.com/docker/distribution/issues/1621
// (see also https://github.com/docker/docker/issues/22378,
// https://github.com/docker/docker/issues/30083)
"application/octet-stream",
"application/json",
"text/html",
// Treat defaulted values as images, newer types cannot be implied
"",
}