diff --git a/src/EventSource.js b/src/EventSource.js index 8b2991d..650be82 100644 --- a/src/EventSource.js +++ b/src/EventSource.js @@ -228,7 +228,7 @@ class EventSource { this.interval = retry; } } else if (line.startsWith('data')) { - data.push(line.replace(/data:?\s*/, '')); + data.push(line.replace(/^data: ?/, '')); } else if (line.startsWith('id')) { id = line.replace(/id:?\s*/, ''); if (id !== '') {