Skip to content

Commit

Permalink
Updated brotli detection method
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi committed Aug 25, 2020
1 parent ff788ac commit c08e899
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/read.js
Expand Up @@ -27,7 +27,7 @@ module.exports = read
* @const
* whether current node version has brotli support
*/
var hasBrotliSupport = 'brotli' in process.versions
var hasBrotliSupport = 'createBrotliDecompress' in zlib

/**
* Read a request into a buffer and parse.
Expand Down
2 changes: 1 addition & 1 deletion test/json.js
Expand Up @@ -10,7 +10,7 @@ var bodyParser = require('..')
* @const
* whether current node version has brotli support
*/
var hasBrotliSupport = 'brotli' in process.versions
var hasBrotliSupport = 'createBrotliDecompress' in require('zlib')

describe('bodyParser.json()', function () {
it('should parse JSON', function (done) {
Expand Down
2 changes: 1 addition & 1 deletion test/raw.js
Expand Up @@ -10,7 +10,7 @@ var bodyParser = require('..')
* @const
* whether current node version has brotli support
*/
var hasBrotliSupport = 'brotli' in process.versions
var hasBrotliSupport = 'createBrotliDecompress' in require('zlib')

describe('bodyParser.raw()', function () {
before(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/text.js
Expand Up @@ -10,7 +10,7 @@ var bodyParser = require('..')
* @const
* whether current node version has brotli support
*/
var hasBrotliSupport = 'brotli' in process.versions
var hasBrotliSupport = 'createBrotliDecompress' in require('zlib')

describe('bodyParser.text()', function () {
before(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/urlencoded.js
Expand Up @@ -10,7 +10,7 @@ var bodyParser = require('..')
* @const
* whether current node version has brotli support
*/
var hasBrotliSupport = 'brotli' in process.versions
var hasBrotliSupport = 'createBrotliDecompress' in require('zlib')

describe('bodyParser.urlencoded()', function () {
before(function () {
Expand Down

0 comments on commit c08e899

Please sign in to comment.