From 2764de3e02a5b0052070f6568612fc9af3ce7249 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 22 Jan 2019 22:48:57 +0100 Subject: [PATCH] add fallback for RP mbox, add a few more tests --- index.js | 2 +- test.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index b2ed655..4b81ee0 100644 --- a/index.js +++ b/index.js @@ -913,7 +913,7 @@ rrp.decode = function (buf, offset) { rrp.decode.bytes = 0 rrp.encodingLength = function (data) { - return 2 + name.encodingLength(data.mbox) + name.encodingLength(data.txt || '.') + return 2 + name.encodingLength(data.mbox || '.') + name.encodingLength(data.txt || '.') } const typebitmap = {} diff --git a/test.js b/test.js index c49bf8f..207d623 100644 --- a/test.js +++ b/test.js @@ -405,9 +405,12 @@ tape('rrp', function (t) { txt: 'baz.bar.com' }) testEncoder(t, packet.rp, { - mbox: 'rp.world.com', - txt: '.' + mbox: 'foo.bar.com' }) + testEncoder(t, packet.rp, { + txt: 'baz.bar.com' + }) + testEncoder(t, packet.rp, {}) t.end() })