From 05b782ce13de0e5934fdf010fa06bc48f8731b74 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Wed, 7 Oct 2020 17:52:31 +0200 Subject: [PATCH] fix: node 12.9 (#449) Fixes: https://github.com/nodejs/undici/issues/448 --- lib/core/client.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/core/client.js b/lib/core/client.js index 9f8b93c81d4..9ff693b12db 100644 --- a/lib/core/client.js +++ b/lib/core/client.js @@ -346,7 +346,14 @@ class Client extends EventEmitter { class Parser extends HTTPParser { constructor (client, socket) { /* istanbul ignore next */ - if (nodeMajorVersion >= 12) { + if (nodeMajorVersion === 12) { + super() + this.initialize( + HTTPParser.RESPONSE, + {}, + client[kHeadersTimeout] + ) + } else if (nodeMajorVersion > 12) { super() this.initialize( HTTPParser.RESPONSE,