From d2a41194db58ee80987fee2e32b79f71185ec817 Mon Sep 17 00:00:00 2001 From: David Vultur Date: Wed, 17 Jun 2020 17:24:49 +0300 Subject: [PATCH] Fixed response NSCOUNT/ARCOUNT _authority and _additional are never filled with data but at response, the corresponding counters are not 0 but contain the counters from the request which will produce a malformed response --- lib/query.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/query.js b/lib/query.js index 04ecaab..b42d865 100644 --- a/lib/query.js +++ b/lib/query.js @@ -72,8 +72,10 @@ Query.prototype.encode = function encode() { flags: this._flags, qdCount: this._qdCount, anCount: this._anCount, - nsCount: this._nsCount, - srCount: this._srCount + // nsCount: this._nsCount, + // srCount: this._srCount + nsCount: this._authority ? this._authority.length : 0, + srCount: this._additional ? this._additional.length : 0 }, question: this._question, answers: this._answers,