zed
zed copied to clipboard
remove GET /events content negotiation
GET /events
provides server-sent events. It currently performs server-driven content negotiation, and the negotiated content type is used to encode "data" values in the response body. There are a couple of problems with this as currently implemented.
- A request header of "Accept: text/event-stream" is allowed by the server-sent events specification but causes content negotiation to fail.
- The specification requires a UTF-8 stream in the response body, but a binary negotiated content type (e.g., Parquet or ZNG) can produce non-UTF-8 "data" values.
The desktop app is this route's only known user, and it always requests JSON, so a simple way to fix these problems is to remove the content negotiation, ignore the Accept request header entirely, and always encode "data" values as JSON.