浏览代码

Disable compression when content-type is text/event-stream

yhirose 5 年之前
父节点
当前提交
90da199aba
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      httplib.h

+ 2 - 1
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" ||