@nxtedition/nxt-undici 6.1.1 → 6.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,6 @@ import { DecoratorHandler, parseCacheControl } from '../utils.js'
3
3
 
4
4
  const DEFAULT_STORE = new undici.cacheStores.SqliteCacheStore({ location: ':memory:' })
5
5
  const DEFAULT_MAX_ENTRY_SIZE = 128 * 1024
6
- const EMPTY_BUFFER = Buffer.alloc(0)
7
6
  const NOOP = () => {}
8
7
 
9
8
  class CacheHandler extends DecoratorHandler {
@@ -201,9 +200,11 @@ export default () => (dispatch) => (opts, handler) => {
201
200
  return
202
201
  }
203
202
 
204
- handler.onData(body ?? EMPTY_BUFFER)
205
- if (aborted) {
206
- return
203
+ if (body?.byteLength) {
204
+ handler.onData(body)
205
+ if (aborted) {
206
+ return
207
+ }
207
208
  }
208
209
 
209
210
  handler.onComplete({})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",