From 4639686a22b13c9e5648f6fbc0c5df4427126f02 Mon Sep 17 00:00:00 2001 From: devin ivy Date: Sat, 20 Mar 2021 11:21:32 -0400 Subject: [PATCH] Future-proof hapi for node v16, rely on res close rather than req (#4225) --- lib/request.js | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/request.js b/lib/request.js index deeb577d5..1cfc0b89d 100755 --- a/lib/request.js +++ b/lib/request.js @@ -309,7 +309,7 @@ exports = module.exports = internals.Request = class { this.raw.req.on('end', internals.event.bind(this.raw.req, this._eventContext, 'end')); } - this.raw.req.on('close', internals.event.bind(this.raw.req, this._eventContext, 'close')); + this.raw.res.on('close', internals.event.bind(this.raw.res, this._eventContext, 'close')); this.raw.req.on('error', internals.event.bind(this.raw.req, this._eventContext, 'error')); this.raw.req.on('aborted', internals.event.bind(this.raw.req, this._eventContext, 'abort')); this.raw.res.once('close', internals.closed.bind(this.raw.res, this)); diff --git a/package.json b/package.json index b9d53ed9d..c0a4988c3 100755 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@hapi/hoek": "9.x.x", "@hapi/mimos": "5.x.x", "@hapi/podium": "^4.1.1", - "@hapi/shot": "^5.0.1", + "@hapi/shot": "^5.0.5", "@hapi/somever": "3.x.x", "@hapi/statehood": "^7.0.3", "@hapi/subtext": "^7.0.3", @@ -42,8 +42,8 @@ "@hapi/inert": "^6.0.2", "@hapi/joi-legacy-test": "npm:@hapi/joi@15.x.x", "@hapi/lab": "24.x.x", - "@hapi/wreck": "17.x.x", "@hapi/vision": "^6.0.1", + "@hapi/wreck": "17.x.x", "handlebars": "^4.5.3", "joi": "17.x.x" },