Skip to content

Commit 4639686

Browse files
authored
Future-proof hapi for node v16, rely on res close rather than req (hapijs#4225)
1 parent 19f27f5 commit 4639686

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ exports = module.exports = internals.Request = class {
309309
this.raw.req.on('end', internals.event.bind(this.raw.req, this._eventContext, 'end'));
310310
}
311311

312-
this.raw.req.on('close', internals.event.bind(this.raw.req, this._eventContext, 'close'));
312+
this.raw.res.on('close', internals.event.bind(this.raw.res, this._eventContext, 'close'));
313313
this.raw.req.on('error', internals.event.bind(this.raw.req, this._eventContext, 'error'));
314314
this.raw.req.on('aborted', internals.event.bind(this.raw.req, this._eventContext, 'abort'));
315315
this.raw.res.once('close', internals.closed.bind(this.raw.res, this));

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@hapi/hoek": "9.x.x",
3030
"@hapi/mimos": "5.x.x",
3131
"@hapi/podium": "^4.1.1",
32-
"@hapi/shot": "^5.0.1",
32+
"@hapi/shot": "^5.0.5",
3333
"@hapi/somever": "3.x.x",
3434
"@hapi/statehood": "^7.0.3",
3535
"@hapi/subtext": "^7.0.3",
@@ -42,8 +42,8 @@
4242
"@hapi/inert": "^6.0.2",
4343
"@hapi/joi-legacy-test": "npm:@hapi/joi@15.x.x",
4444
"@hapi/lab": "24.x.x",
45-
"@hapi/wreck": "17.x.x",
4645
"@hapi/vision": "^6.0.1",
46+
"@hapi/wreck": "17.x.x",
4747
"handlebars": "^4.5.3",
4848
"joi": "17.x.x"
4949
},

0 commit comments

Comments
 (0)