@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.
- package/lib/interceptor/cache.js +5 -4
- package/package.json +1 -1
package/lib/interceptor/cache.js
CHANGED
|
@@ -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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
if (body?.byteLength) {
|
|
204
|
+
handler.onData(body)
|
|
205
|
+
if (aborted) {
|
|
206
|
+
return
|
|
207
|
+
}
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
handler.onComplete({})
|