Skip to content

Commit 2e560f9

Browse files
committed
clarify server_sent_event RFC specs
1 parent 1cf769b commit 2e560f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/server/utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ static bool server_sent_event(httplib::DataSink & sink, const char * event, cons
479479
const std::string str =
480480
std::string(event) + ": " +
481481
data.dump(-1, ' ', false, json::error_handler_t::replace) +
482-
"\n\n"; // note: these newlines are important (not sure why though, if you know, add a comment to explain)
482+
"\n\n"; // required by RFC 8895 - A message is terminated by a blank line (two line terminators in a row).
483483

484484
LOG_DBG("data stream, to_send: %s", str.c_str());
485485

0 commit comments

Comments
 (0)