Skip to content

SSE client trims all whitespace from the data part, but the spec says only trim a single optional space character #1044

@basfp

Description

@basfp

In sse.go function trimHeader calls data = bytes.TrimSpace(data), which removes all whitespace left and right of the data value.

But the spec says:

If value starts with a U+0020 SPACE character, remove it from value.

My service sends data: lines where the data can start with whitespace, which should be preserved. E.g.

data: word (two spaces, one from the SSE format and one as part of the value).

Metadata

Metadata

Assignees

No one assigned

    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