httpd gzip compression / set a response header and search for gzip in the request header in case deflate is added to gzip in there

This commit is contained in:
Benjamin Sergeant 2020-06-01 17:11:42 -07:00
parent 31be2e2527
commit 268f528423

View File

@ -164,9 +164,10 @@ namespace ix
std::string content = res.second; std::string content = res.second;
std::string acceptEncoding = request->headers["Accept-encoding"]; std::string acceptEncoding = request->headers["Accept-encoding"];
if (acceptEncoding == "gzip" || acceptEncoding == "*") if (acceptEncoding == "*" || acceptEncoding.find("gzip") != std::string::npos)
{ {
content = gzipCompress(content); content = gzipCompress(content);
headers["Content-Encoding"] = "gzip";
} }
// Log request // Log request