mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
use mime-type application/jsonl to align with openapi 3.2
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
b8093b76fb
commit
aef5d996ce
@@ -21,7 +21,7 @@ func NewJSONStreamEncoder(w io.Writer, contentType string) EncoderFn {
|
||||
json: jsonEncoder,
|
||||
}
|
||||
return jseq.Encode
|
||||
case types.MediaTypeNDJSON, types.MediaTypeJSON:
|
||||
case types.MediaTypeNDJSON, types.MediaTypeJSON, types.MediaTypeJSONLines:
|
||||
fallthrough
|
||||
default:
|
||||
return jsonEncoder.Encode
|
||||
|
||||
@@ -311,6 +311,7 @@ func (s *systemRouter) getEvents(ctx context.Context, w http.ResponseWriter, r *
|
||||
}
|
||||
|
||||
contentType := httputil.NegotiateContentType(r, []string{
|
||||
types.MediaTypeJSONLines,
|
||||
types.MediaTypeNDJSON,
|
||||
types.MediaTypeJSONSequence,
|
||||
}, types.MediaTypeJSON) // output isn't actually JSON but API used to this content-type
|
||||
|
||||
Reference in New Issue
Block a user