podman
podman copied to clipboard
Compat API: negotiate events content type via Accept
Feature request description
Compat GET /events always answers with application/json. Newer Docker clients send an Accept header and pick how to read the stream from the response Content-Type, so we should negotiate it: application/x-ndjson and application/json-seq from API v1.52, and application/jsonl from v1.53.
Suggest potential solution
Read Accept in the compat events handler, pick the best supported type for the requested API version, and fall back to application/json for older versions and for the libpod endpoint.
Have you considered any alternatives?
No
Additional context
Split out of the events Accept items in #30164 (v1.52) and #30165 (v1.53).
/assign