Skip to content

Commit

Permalink
sort conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohansebas committed Nov 16, 2024
1 parent 66c0cb7 commit 7e00d42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 7e00d42

Please sign in to comment.