From 7e00d42978bd96f702b6af4a780646a2f686ccb8 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 16 Nov 2024 14:44:56 -0500 Subject: [PATCH] sort conditional --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index d9f650c..70d3491 100644 --- a/index.js +++ b/index.js @@ -181,7 +181,7 @@ function compression (options) { var method = negotiator.encoding(['gzip', 'deflate', 'identity'], ['gzip']) // if no method is found, use the default encoding - if (encodingSupported.indexOf(enforceEncoding) !== -1 && !req.headers['accept-encoding']) { + if (!req.headers['accept-encoding'] && encodingSupported.indexOf(enforceEncoding) !== -1) { method = enforceEncoding === '*' ? 'gzip' : enforceEncoding }