registry: fix binary JSON content-type
This fixes registry endpoints to return the proper `application/json` content-type for JSON content, also updating spec examples for that. As per IETF specification and IANA registry [0], the `application/json` type is a binary media, so the content-type label does not need any text-charset selector. Additionally, the media type definition explicitly states that it has no required nor optional parameters, which makes the current registry headers non-compliant. [0]: https://www.iana.org/assignments/media-types/application/json Signed-off-by: Luca Bruno <lucab@debian.org>
This commit is contained in:
parent
91b0f0559e
commit
15b0204758
12 changed files with 135 additions and 135 deletions
|
@ -126,7 +126,7 @@ var (
|
|||
},
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
ErrorCodes: []errcode.ErrorCode{
|
||||
|
@ -147,7 +147,7 @@ var (
|
|||
},
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
ErrorCodes: []errcode.ErrorCode{
|
||||
|
@ -168,7 +168,7 @@ var (
|
|||
},
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
ErrorCodes: []errcode.ErrorCode{
|
||||
|
@ -189,7 +189,7 @@ var (
|
|||
},
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
ErrorCodes: []errcode.ErrorCode{
|
||||
|
@ -441,7 +441,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
},
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: `{
|
||||
"name": <name>,
|
||||
"tags": [
|
||||
|
@ -478,7 +478,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
linkHeader,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: `{
|
||||
"name": <name>,
|
||||
"tags": [
|
||||
|
@ -541,7 +541,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeTagInvalid,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -592,7 +592,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
Description: "The received manifest was invalid in some way, as described by the error codes. The client should resolve the issue and retry the request.",
|
||||
StatusCode: http.StatusBadRequest,
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
ErrorCodes: []errcode.ErrorCode{
|
||||
|
@ -615,7 +615,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUnknown,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: `{
|
||||
"errors:" [{
|
||||
"code": "BLOB_UNKNOWN",
|
||||
|
@ -669,7 +669,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeTagInvalid,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -686,7 +686,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeManifestUnknown,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -766,7 +766,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeDigestInvalid,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -774,7 +774,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
Description: "The blob, identified by `name` and `digest`, is unknown to the registry.",
|
||||
StatusCode: http.StatusNotFound,
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
ErrorCodes: []errcode.ErrorCode{
|
||||
|
@ -838,7 +838,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeDigestInvalid,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -849,7 +849,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUnknown,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -905,7 +905,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
Description: "The blob, identified by `name` and `digest`, is unknown to the registry.",
|
||||
StatusCode: http.StatusNotFound,
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
ErrorCodes: []errcode.ErrorCode{
|
||||
|
@ -917,7 +917,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
Description: "Blob delete is not allowed because the registry is configured as a pull-through cache or `delete` has been disabled",
|
||||
StatusCode: http.StatusMethodNotAllowed,
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
ErrorCodes: []errcode.ErrorCode{
|
||||
|
@ -1179,7 +1179,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUploadInvalid,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -1190,7 +1190,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUploadUnknown,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -1254,7 +1254,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUploadInvalid,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -1265,7 +1265,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUploadUnknown,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -1336,7 +1336,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUploadInvalid,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -1347,7 +1347,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUploadUnknown,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -1431,7 +1431,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
errcode.ErrorCodeUnsupported,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -1442,7 +1442,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUploadUnknown,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -1488,7 +1488,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUploadInvalid,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -1499,7 +1499,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
ErrorCodeBlobUploadUnknown,
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
},
|
||||
|
@ -1539,7 +1539,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
},
|
||||
},
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: `{
|
||||
"repositories": [
|
||||
<name>,
|
||||
|
@ -1558,7 +1558,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||
{
|
||||
StatusCode: http.StatusOK,
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json; charset=utf-8",
|
||||
ContentType: "application/json",
|
||||
Format: `{
|
||||
"repositories": [
|
||||
<name>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue