Skip to content

Conversation

@x
Copy link
Contributor

@x x commented May 10, 2018

My team and I ran into an issue with subscribing to the HTTPHandler from a web client. It seems like the existing format for the event doesn't match the W3 recommendation.

W3 specifies that there should be a an empty new-line character between events.

For example:

id: 0
event: add
data: this is the first event

id: 1
event: add
data: this is the second event

id: 2
event: add
data: this is the third event

Currently the HTTPHandler doesn't new-line separate.

For example:

id: 0
event: add
data: this is the first event
id: 1
event: add
data: this is the second event
id: 2
event: add
data: this is the third event

The existing client in this library doesn't care about this distinction, but a web browser such as Chrome or Safari or a JS client can't parse the events. Adding a new-line fixes this.

Making this change doesn't effect the current client because it defaults to no behavior.

@purehyperbole
Copy link
Member

Excellent. Thanks for the PR!

@purehyperbole purehyperbole merged commit 03596eb into r3labs:master May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants