Skip to content

Commit 1c93d4f

Browse files
gyx1000ryanblock
authored andcommitted
Use includes instead of has
1 parent 59590e8 commit 1c93d4f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/http/_res-fmt.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ let httpError = require('./errors')
22
let binaryTypes = require('./helpers/binary-types')
33
let { brotliCompressSync } = require('zlib')
44

5-
let binaryTypesSet = new Set(binaryTypes)
6-
75
module.exports = function responseFormatter (req, params) {
86
let isError = params instanceof Error
97

@@ -170,7 +168,7 @@ module.exports = function responseFormatter (req, params) {
170168

171169
// Handle body encoding (if necessary)
172170
let [ cTest ] = (res.headers['content-type'] || '').split(';')
173-
let isBinary = binaryTypesSet.has(cTest)
171+
let isBinary = binaryTypes.includes(cTest)
174172
let bodyIsString = typeof res.body === 'string'
175173
let b64enc = i => new Buffer.from(i).toString('base64')
176174
function compress (body) {

0 commit comments

Comments
 (0)