diff --git a/src/client.cpp b/src/client.cpp index fc96f54..3c95d14 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -409,10 +409,12 @@ bool connection_handler(const char *preprefix, const char *col1, const char *col if (statuscode != -1) { statuscode = (statuscode == 0) ? 200 : statuscode; - bool compress = /*path.isStatic() &&*/ type.find("text/") == 0 && - req.isExistingField("Accept-Encoding") && - req.getField("Accept-Encoding").find( - "deflate") != string::npos; + bool compress = (type.find("text/") == 0 || + (type.find("application/") == 0 && type.find("+xml") != string::npos) || + type == "application/json" || + type == "application/javascript") && + req.isExistingField("Accept-Encoding") && + req.getField("Accept-Encoding").find("deflate") != string::npos; if (compress) { req.setField("Accept-Ranges", "none");