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>
| ... | ... |
@@ -23,7 +23,11 @@ import ( |
| 23 | 23 |
var ImageTypes = []string{
|
| 24 | 24 |
schema2.MediaTypeImageConfig, |
| 25 | 25 |
// Handle unexpected values from https://github.com/docker/distribution/issues/1621 |
| 26 |
+ // (see also https://github.com/docker/docker/issues/22378, |
|
| 27 |
+ // https://github.com/docker/docker/issues/30083) |
|
| 26 | 28 |
"application/octet-stream", |
| 29 |
+ "application/json", |
|
| 30 |
+ "text/html", |
|
| 27 | 31 |
// Treat defaulted values as images, newer types cannot be implied |
| 28 | 32 |
"", |
| 29 | 33 |
} |