updated npm modules
This commit is contained in:
15
node_modules/compression/index.js
generated
vendored
15
node_modules/compression/index.js
generated
vendored
@@ -85,7 +85,7 @@ function compression (options) {
|
||||
}
|
||||
|
||||
return stream
|
||||
? stream.write(Buffer.from(chunk, encoding))
|
||||
? stream.write(toBuffer(chunk, encoding))
|
||||
: _write.call(this, chunk, encoding)
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ function compression (options) {
|
||||
|
||||
// write Buffer for Node.js 0.8
|
||||
return chunk
|
||||
? stream.end(Buffer.from(chunk, encoding))
|
||||
? stream.end(toBuffer(chunk, encoding))
|
||||
: stream.end()
|
||||
}
|
||||
|
||||
@@ -275,3 +275,14 @@ function shouldTransform (req, res) {
|
||||
return !cacheControl ||
|
||||
!cacheControlNoTransformRegExp.test(cacheControl)
|
||||
}
|
||||
|
||||
/**
|
||||
* Coerce arguments to Buffer
|
||||
* @private
|
||||
*/
|
||||
|
||||
function toBuffer (chunk, encoding) {
|
||||
return !Buffer.isBuffer(chunk)
|
||||
? Buffer.from(chunk, encoding)
|
||||
: chunk
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user