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:
parent
31be2e2527
commit
268f528423
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user