diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index be5d08a0b0a..a9fdcb65954 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -704,8 +704,11 @@ const proxySocketHandler = { // data received on the PING acknowlegement. function pingCallback(cb) { return function pingCallback(ack, duration, payload) { - const err = ack ? null : new ERR_HTTP2_PING_CANCEL(); - cb(err, duration, payload); + if (ack) { + cb(null, duration, payload); + } else { + cb(new ERR_HTTP2_PING_CANCEL()); + } }; }