caching_middleware: fix gzip compression not triggered

This commit is contained in:
webzwo0i 2020-11-16 00:16:41 +01:00
parent 1d8e8d3484
commit b73d3b7243

View file

@ -196,7 +196,7 @@ CachingMiddleware.prototype = new function () {
var statusCode = responseCache[cacheKey].statusCode; var statusCode = responseCache[cacheKey].statusCode;
var pathStr = CACHE_DIR + 'minified_' + cacheKey; var pathStr = CACHE_DIR + 'minified_' + cacheKey;
if (supportsGzip && (headers['content-type'] || '').match(/^text\//)) { if (supportsGzip && (headers['content-type'] || '').match(/^application\/javascript/)) {
pathStr = pathStr + '.gz'; pathStr = pathStr + '.gz';
headers['content-encoding'] = 'gzip'; headers['content-encoding'] = 'gzip';
} }