Skip to content

Missing space after colon in data: field violates SSE specification #4280

@kwinH

Description

@kwinH

The current implementation of the writeData function in sse-encoder.go generates invalid Server-Sent Events (SSE) output by omitting the required space character after the data: field identifier.

Current behavior:

_, _ = w.WriteString("data:") // Missing space after colon

According to the SSE specification, the correct format requires a space character after the colon.

Expected Behavior

_, _ = w.WriteString("data: ") // With space after colon

Impact

This deviation from the specification may cause compatibility issues with:

  1. Strict SSE client implementations
  2. Middleware that enforces protocol compliance
  3. Browsers that follow the specification strictly

Steps to Reproduce

  1. Send any event data through the SSE stream
  2. Observe the raw output format
  3. Notice the missing space after data: field

Proposed Solution

Update the writeData function to include the required space character after the colon. A fix is already implemented in PR #.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions