@@ -255,6 +255,7 @@ class CacheEntry {
255
255
algorithms : this . options . algorithms ,
256
256
metadata : getMetadata ( this . request , this . response , this . options ) ,
257
257
size,
258
+ integrity : this . options . integrity ,
258
259
}
259
260
260
261
let body = null
@@ -273,11 +274,9 @@ class CacheEntry {
273
274
} ,
274
275
} ) )
275
276
276
- let abortStream
277
277
const onResume = ( ) => {
278
278
const tee = new Minipass ( )
279
279
const cacheStream = cacache . put . stream ( this . options . cachePath , this . key , cacheOpts )
280
- abortStream = cacheStream
281
280
tee . pipe ( cacheStream )
282
281
// TODO if the cache write fails, log a warning but return the response anyway
283
282
cacheStream . promise ( ) . then ( cacheWriteResolve , cacheWriteReject )
@@ -287,11 +286,6 @@ class CacheEntry {
287
286
288
287
body . once ( 'resume' , onResume )
289
288
body . once ( 'end' , ( ) => body . removeListener ( 'resume' , onResume ) )
290
- this . response . body . on ( 'error' , ( err ) => {
291
- // listen for errors from the actual response and avoid writing data that we
292
- // know to be invalid to the cache
293
- abortStream . destroy ( err )
294
- } )
295
289
} else {
296
290
await cacache . index . insert ( this . options . cachePath , this . key , null , cacheOpts )
297
291
}
0 commit comments