Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created October 23, 2019 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/38204dd8862e549d5d5209fa1d21b36a to your computer and use it in GitHub Desktop.
Save isaacs/38204dd8862e549d5d5209fa1d21b36a to your computer and use it in GitHub Desktop.
diff --git a/cache.js b/cache.js
index f842ba1..f00de14 100644
--- a/cache.js
+++ b/cache.js
@@ -169,7 +169,7 @@ module.exports = class Cache {
cacheTargetStream ? cacheTargetStream.end(done) : done()
})
const oldBody = response.body
- const newBody = through({highWaterMark: fitInMemory && MAX_MEM_SIZE})
+ const newBody = through({highWaterMark: MAX_MEM_SIZE})
response.body = newBody
oldBody.once('error', err => newBody.emit('error', err))
newBody.once('error', err => oldBody.emit('error', err))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment