Skip to content

v0.12.0

Pre-release
Pre-release

Choose a tag to compare

@tmaxmax tmaxmax released this 06 Nov 19:34
· 2 commits to master since this release
v0.12.0
a2762ac

Fixes EOF handling to correctly follow the SSE specification; otherwise a minor API cleanup update.

Removed

  • Session.Req, Session.Res, and MessageWriter; Server.OnSession gives the request and response directly, and in custom sse.Upgrade usage one has the request and response instances available already.

Changed

  • Updated minimum supported Go version to the oldest officially supported, 1.26.
  • Client.NewConnection now applies defaults to each connection's copy of the client. The original HTTPClient, ResponseValidator and Backoff fields stay unchanged. This breaks code that reads default values from those fields after creating a connection. (thanks @bensynapse)

Fixed

  • Read and Connection now 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. Read treats an incomplete final line as successful end-of-input, while Connection retains 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.NewConnection no longer write to the shared client configuration.