From 90da199aba7b6056286ac726e30c58c6f0cb59b9 Mon Sep 17 00:00:00 2001 From: yhirose Date: Sat, 25 Jul 2020 10:46:52 -0400 Subject: [PATCH] Disable compression when content-type is text/event-stream --- httplib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index 6cc04cc..2fc9f21 100644 --- a/httplib.h +++ b/httplib.h @@ -2316,7 +2316,8 @@ inline const char *status_message(int status) { } inline bool can_compress_content_type(const std::string &content_type) { - return !content_type.find("text/") || content_type == "image/svg+xml" || + return (!content_type.find("text/") && content_type != "text/event-stream") || + content_type == "image/svg+xml" || content_type == "application/javascript" || content_type == "application/json" || content_type == "application/xml" ||