From 2e560f90ff06e9a9b5d12b9ddf3498ab9e1e9b44 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Thu, 5 Dec 2024 16:13:52 +0100 Subject: [PATCH] clarify server_sent_event RFC specs --- examples/server/utils.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/server/utils.hpp b/examples/server/utils.hpp index 70bcaf17c..a96116ac3 100644 --- a/examples/server/utils.hpp +++ b/examples/server/utils.hpp @@ -479,7 +479,7 @@ static bool server_sent_event(httplib::DataSink & sink, const char * event, cons const std::string str = std::string(event) + ": " + data.dump(-1, ' ', false, json::error_handler_t::replace) + - "\n\n"; // note: these newlines are important (not sure why though, if you know, add a comment to explain) + "\n\n"; // required by RFC 8895 - A message is terminated by a blank line (two line terminators in a row). LOG_DBG("data stream, to_send: %s", str.c_str());