Repository navigation
v0.12.0
Pre-release
Pre-release
Fixes EOF handling to correctly follow the SSE specification; otherwise a minor API cleanup update.
Removed
Session.Req,Session.Res, andMessageWriter;Server.OnSessiongives the request and response directly, and in customsse.Upgradeusage one has the request and response instances available already.
Changed
- Updated minimum supported Go version to the oldest officially supported, 1.26.
Client.NewConnectionnow applies defaults to each connection's copy of the client. The originalHTTPClient,ResponseValidatorandBackofffields stay unchanged. This breaks code that reads default values from those fields after creating a connection. (thanks @bensynapse)
Fixed
ReadandConnectionnow discard incomplete final events at EOF. The SSE specification requires a blank line to dispatch an event; reaching EOF alone must not turn a truncated event into a successful one. Producers must terminate the final event with a blank line for it to be delivered.Readtreats an incomplete final line as successful end-of-input, whileConnectionretains its existing EOF and reconnection behavior. (thanks @CaliLuke)- Preserve underlying reader errors when a partial final field is buffered, so an unexpected-EOF parser error does not hide the cause of a failed read.
- Concurrent calls to
Client.NewConnectionno longer write to the shared client configuration.