From 8e6311055cf10552f4d6d98ac6802f35947dc7b4 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Fri, 20 Nov 2020 00:56:13 +0100 Subject: [PATCH] caching_middleware: use `test` instead of `match` --- src/node/utils/caching_middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/utils/caching_middleware.js b/src/node/utils/caching_middleware.js index a31fc1bcc..366085c4b 100644 --- a/src/node/utils/caching_middleware.js +++ b/src/node/utils/caching_middleware.js @@ -196,7 +196,7 @@ CachingMiddleware.prototype = new function () { var statusCode = responseCache[cacheKey].statusCode; var pathStr = CACHE_DIR + 'minified_' + cacheKey; - if (supportsGzip && (headers['content-type'] || '').match(/^application\/javascript/)) { + if (supportsGzip && /^application\/javascript/.test(headers['content-type'])) { pathStr = pathStr + '.gz'; headers['content-encoding'] = 'gzip'; } else {