aboutsummaryrefslogtreecommitdiff
path: root/lib/http
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-11-24 21:45:41 +0700
committerShulhan <ms@kilabit.info>2023-11-26 21:32:52 +0700
commit93c7f9f18eafb68ff892a2ecb3de25d8a56d3e84 (patch)
treeb9ecfe6c27036cbc633eef4e3ea2e4b05e6eb9f9 /lib/http
parent423c3fde1cd36d55c8fc4cdbf58394b5177dea05 (diff)
downloadpakakeh.go-93c7f9f18eafb68ff892a2ecb3de25d8a56d3e84.tar.xz
http/sseclient: remove double check for non-empty packet
Let the parseEvent handle and check for empty packet.
Diffstat (limited to 'lib/http')
-rw-r--r--lib/http/sseclient/sseclient.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/http/sseclient/sseclient.go b/lib/http/sseclient/sseclient.go
index 71bef4c0..ed799114 100644
--- a/lib/http/sseclient/sseclient.go
+++ b/lib/http/sseclient/sseclient.go
@@ -125,11 +125,9 @@ func (cl *Client) Connect(header http.Header) (err error) {
default:
}
- if len(packet) != 0 {
- // The HTTP response may contains events in the body,
- // consume it.
- cl.parseEvent(packet)
- }
+ // The HTTP response may contains events in the body,
+ // consume it.
+ cl.parseEvent(packet)
go cl.consume()