Skip to content

Commit

Permalink
Supprot SSEvent event = NULL (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj010308 committed May 29, 2024
1 parent 6900f97 commit 336e748
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion http/server/HttpResponseWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ int HttpResponseWriter::SSEvent(const std::string& data, const char* event /* =
EndHeaders("Content-Type", "text/event-stream");
}
std::string msg;
msg = "event: "; msg += event; msg += "\n";
if (event) {
msg = "event: "; msg += event; msg += "\n";
}
msg += "data: "; msg += data; msg += "\n\n";
state = SEND_BODY;
return write(msg);
Expand Down

0 comments on commit 336e748

Please sign in to comment.