Skip to content

Commit 48aa1f1

Browse files
author
Dan Richelson
committed
Address PR comments
1 parent c8d6243 commit 48aa1f1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ldclient/sse_client.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,6 @@ def parse(cls, raw):
137137
and return a Event object.
138138
"""
139139
msg = cls()
140-
if raw.startswith(':'):
141-
msg.event = 'comment'
142-
msg.data = raw[1:]
143-
return msg
144-
145140
for line in raw.split('\n'):
146141
m = cls.sse_line_pattern.match(line)
147142
if m is None:
@@ -151,6 +146,9 @@ def parse(cls, raw):
151146

152147
name = m.groupdict()['name']
153148
value = m.groupdict()['value']
149+
if name == '':
150+
# line began with a ":", so is a comment. Ignore
151+
continue
154152

155153
if name == 'data':
156154
# If we already have some data, then join to it with a newline.

0 commit comments

Comments
 (0)