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() })