mirror of
https://github.com/penpot/penpot.git
synced 2026-08-29 16:18:48 +00:00
SSE endpoints always encoded event payloads in transit, ignoring request content negotiation. Extract the response format negotiation (Accept header and _fmt query param) into a shared app.http.content-negotiation helper and use it from both the response formatting middleware and the SSE response builder. SSE event payloads are now encoded as transit (default) or plain JSON depending on the request, while the text/event-stream transport remains unchanged. On the frontend, stream requests now accept a :response-format :json option that switches the Accept header and decodes each event with the plain JSON decoder. AI-assisted-by: glm-5.3-flash