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
@@ -17,7 +17,7 @@ func NewJSONStreamDecoder(r io.Reader, contentType string) DecoderFn {
|
||||
switch contentType {
|
||||
case types.MediaTypeJSONSequence:
|
||||
return json.NewDecoder(NewRSFilterReader(r)).Decode
|
||||
case types.MediaTypeJSON, types.MediaTypeNDJSON:
|
||||
case types.MediaTypeJSON, types.MediaTypeNDJSON, types.MediaTypeJSONLines:
|
||||
fallthrough
|
||||
default:
|
||||
return json.NewDecoder(r).Decode
|
||||
|
||||
@@ -46,6 +46,7 @@ func (cli *Client) Events(ctx context.Context, options EventsListOptions) Events
|
||||
|
||||
headers := http.Header{}
|
||||
headers.Add("Accept", types.MediaTypeJSONSequence)
|
||||
headers.Add("Accept", types.MediaTypeJSONLines)
|
||||
headers.Add("Accept", types.MediaTypeNDJSON)
|
||||
resp, err := cli.get(ctx, "/events", query, headers)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user