@nxtedition/lib 21.5.6 → 21.5.8
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 +5 -0
- package/package.json +1 -1
package/http.js
CHANGED
|
@@ -113,10 +113,15 @@ export class Context {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
function noop() {}
|
|
117
|
+
|
|
116
118
|
export async function request2(ctx, next) {
|
|
117
119
|
const { req, res, logger } = ctx
|
|
118
120
|
const startTime = performance.now()
|
|
119
121
|
|
|
122
|
+
req.on('error', noop)
|
|
123
|
+
res.on('error', noop)
|
|
124
|
+
|
|
120
125
|
try {
|
|
121
126
|
if (req.method === 'GET' || req.method === 'HEAD') {
|
|
122
127
|
req.resume() // Dump the body if there is one.
|