diff --git a/lib/provider/aws/is-binary.js b/lib/provider/aws/is-binary.js index 59a3cdf..c3a2601 100644 --- a/lib/provider/aws/is-binary.js +++ b/lib/provider/aws/is-binary.js @@ -1,6 +1,6 @@ 'use strict'; -const BINARY_ENCODINGS = ['gzip', 'deflate', 'br']; +const BINARY_ENCODINGS = ['gzip', 'deflate', 'br', 'zstd']; const BINARY_CONTENT_TYPES = (process.env.BINARY_CONTENT_TYPES || '').split(','); function isBinaryEncoding(headers) { diff --git a/lib/provider/azure/is-binary.js b/lib/provider/azure/is-binary.js index 59a3cdf..c3a2601 100644 --- a/lib/provider/azure/is-binary.js +++ b/lib/provider/azure/is-binary.js @@ -1,6 +1,6 @@ 'use strict'; -const BINARY_ENCODINGS = ['gzip', 'deflate', 'br']; +const BINARY_ENCODINGS = ['gzip', 'deflate', 'br', 'zstd']; const BINARY_CONTENT_TYPES = (process.env.BINARY_CONTENT_TYPES || '').split(','); function isBinaryEncoding(headers) { diff --git a/test/is-binary.js b/test/is-binary.js index d666c61..3a1f434 100644 --- a/test/is-binary.js +++ b/test/is-binary.js @@ -6,6 +6,18 @@ const sinon = require('sinon'); describe('is-binary', function() { + it('handles content-encoding', function() { + const result = isBinary({ ['content-encoding']: 'gzip' }, {}); + + expect(result).to.be.true; + }); + + it('handles zstd content-encoding', function() { + const result = isBinary({ ['content-encoding']: 'zstd' }, {}); + + expect(result).to.be.true; + }); + it('handles charset', function() { const result = isBinary({ ['content-type']: 'application/json; charset:utf-8' }, { binary: ['application/json']