You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for alternative line endings (fix problem with sse-starlette) (#45)
* Remove global eventType property
* Refactor string trim and startsWith functions
* Rename lastIndexProcessed to _lastIndexProcessed
* Add support for alternative line endings
* Simplify event id parsing
* Refactor line ending detection
* Refactor detectNewLineChar. Throw an error when line ending not detected. Add lineEndingCharacter option.
* Display warning when line-ending character not detected. Bring back 'id' handler that resets Last-Event-ID
* Improve setting and resetting of lastEventId
* Format code
---------
Co-authored-by: Wojciech Król <wk20981@gmail.com>
body: undefined, // Your request body sent on connection. Default: undefined
196
196
debug: false, // Show console.debug messages for debugging purpose. Default: false
197
197
pollingInterval: 5000, // Time (ms) between reconnections. If set to 0, reconnections will be disabled. Default: 5000
198
+
lineEndingCharacter: null// Character(s) used to represent line endings in received data. Common values: '\n' for LF (Unix/Linux), '\r\n' for CRLF (Windows), '\r' for CR (older Mac). Default: null (Automatically detect from event)
console.warn("[EventSource] Unable to identify the line ending character. Ensure your server delivers a standard line ending character: \\r\\n, \\n, \\r, or specify your custom character using the 'lineEndingCharacter' option.");
0 commit comments