From 68f44878d37a52b9daf28f3ea5fd1afefef9ead3 Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Sun, 13 May 2018 21:59:02 +0200 Subject: [PATCH] Disable Error overrides --- lib/request.js | 5 ++++- lib/request.js.map | 2 +- package.json | 2 +- src/request.ts | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/request.js b/lib/request.js index 1ab0060..d2dda92 100644 --- a/lib/request.js +++ b/lib/request.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const binary_parser_1 = require("binary-parser"); +const types_1 = require("./types"); const MAX_LABEL_SIZE = 63; var QueryTypes; (function (QueryTypes) { @@ -152,6 +153,7 @@ class Request { packet.copy(bodyData, 0, 12, packet.length); this._header = headerParser.parse(headerData); this._header.AD = 0; + this._header.RCODE = types_1.ErrorCodes.NoError; this._questions = parseQuestions(this._header.QDCOUNT, bodyData); } get header() { @@ -161,7 +163,8 @@ class Request { return this._questions.map(e => e); } error(error) { - this._header.RCODE = error; + if (this._header.RCODE === types_1.ErrorCodes.NoError) + this._header.RCODE = error; } send() { this.sendCallback(this.serialize()); diff --git a/lib/request.js.map b/lib/request.js.map index 141af7d..319bed1 100644 --- a/lib/request.js.map +++ b/lib/request.js.map @@ -1 +1 @@ -{"version":3,"file":"request.js","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":";;AAAA,iDAAsC;AAGtC,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,IAAY,UA8GX;AA9GD,WAAY,UAAU;IACnB;;OAEG;IACH,qCAAQ,CAAA;IAER;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,6CAAY,CAAA;IAEZ;;OAEG;IACH,yCAAU,CAAA;IAEV;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;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AC,MAAM,CAAC;IACtB,CAAC;IAGD,IAAI,GAAG,CAAC,KAAK;QACV,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,UAAU;YAAE,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAA;IAC3F,CAAC;IAED,IAAI,GAAG;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC;IACpB,CAAC;IAID,IAAI,QAAQ;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC5B,CAAC;CACH;AApCD,wCAoCC"} \ No newline at end of file +{"version":3,"file":"request.js","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":";;AAAA,iDAAsC;AACtC,mCAAoG;AAEpG,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,IAAY,UA8GX;AA9GD,WAAY,UAAU;IACnB;;OAEG;IACH,qCAAQ,CAAA;IAER;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,6CAAY,CAAA;IAEZ;;OAEG;IACH,yCAAU,CAAA;IAEV;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,4CAAW,CAAA;IAEX;;OAEG;IACH,0CAAU,CAAA;IAEV;;OAEG;IACH,0CAAU,CAAA;IAEV;;OAEG;IACH,8CAAY,CAAA;IAEZ;;OAEG;IACH,8CAAY,CAAA;IAEZ;;OAEG;IACH,wCAAS,CAAA;IAET;;OAEG;IACH,0CAAU,CAAA;IAEV;;OAEG;IACH,4CAAW,CAAA;IAEX;;OAEG;IACH,0CAAU,CAAA;IAEV;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,+CAAY,CAAA;IAEZ;;OAEG;IACH,+CAAY,CAAA;IAEZ;;OAEG;IACH,2CAAU,CAAA;AACb,CAAC,EA9GW,UAAU,GAAV,kB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;IAC5B,CAAC;CACH;AApCD,wCAoCC"} \ No newline at end of file diff --git a/package.json b/package.json index b7008e3..4c7184a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodename-core", - "version": "0.1.4", + "version": "0.1.5", "main": "lib/listener.js", "types": "lib/listener.d.ts", "author": "Fabian Stamm ", diff --git a/src/request.ts b/src/request.ts index 3835254..6339b70 100644 --- a/src/request.ts +++ b/src/request.ts @@ -190,11 +190,13 @@ export class Request implements Message { this._header = headerParser.parse(headerData); this._header.AD = 0; + this._header.RCODE = ErrorCodes.NoError; this._questions = parseQuestions(this._header.QDCOUNT, bodyData); } error(error: ErrorCodes) { - this._header.RCODE = error; + if (this._header.RCODE === ErrorCodes.NoError) + this._header.RCODE = error; } send() {