@nxtedition/lib 26.7.0 → 26.8.0
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/http.js +9 -9
- package/package.json +1 -1
package/http.js
CHANGED
|
@@ -364,15 +364,7 @@ export async function requestMiddleware(ctx, next) {
|
|
|
364
364
|
stats.pending--
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
if (
|
|
368
|
-
// Do nothing..
|
|
369
|
-
} else {
|
|
370
|
-
res.on('error', noop)
|
|
371
|
-
res.destroy()
|
|
372
|
-
ctx.logger?.warn('request destroyed')
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
{
|
|
367
|
+
if (ctx[kPendingIndex] !== -1) {
|
|
376
368
|
const idx = ctx[kPendingIndex]
|
|
377
369
|
const tmp = pending.pop()
|
|
378
370
|
if (tmp !== ctx) {
|
|
@@ -381,6 +373,14 @@ export async function requestMiddleware(ctx, next) {
|
|
|
381
373
|
tmp[kPendingIndex] = -1
|
|
382
374
|
}
|
|
383
375
|
}
|
|
376
|
+
|
|
377
|
+
if (res.writableEnded || res.destroyed || res.stream?.destroyed) {
|
|
378
|
+
// Do nothing..
|
|
379
|
+
} else {
|
|
380
|
+
res.on('error', noop)
|
|
381
|
+
res.destroy()
|
|
382
|
+
ctx.logger?.warn('request destroyed')
|
|
383
|
+
}
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
|