From 24609a63726a6d66ea89f9b35f4b3d1786b28ed6 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 28 Sep 2024 10:11:32 -0500 Subject: [PATCH] fix logic --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5c8ae82..69e7287 100644 --- a/index.js +++ b/index.js @@ -186,7 +186,7 @@ function compression (options) { } // if no method is found, use the default encoding - if (encodingSupported.indexOf(defaultEncoding) !== -1 && req.headers['accept-encoding'].split(',')[0] === '') { + if (encodingSupported.indexOf(defaultEncoding) !== -1 && !req.headers['accept-encoding']) { method = defaultEncoding === '*' ? 'gzip' : defaultEncoding }