forked from LittleChest/dns-packet
add fallback for RP mbox, add a few more tests
This commit is contained in:
parent
0d8791efad
commit
2764de3e02
2
index.js
2
index.js
@ -913,7 +913,7 @@ rrp.decode = function (buf, offset) {
|
|||||||
rrp.decode.bytes = 0
|
rrp.decode.bytes = 0
|
||||||
|
|
||||||
rrp.encodingLength = function (data) {
|
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 = {}
|
const typebitmap = {}
|
||||||
|
|||||||
7
test.js
7
test.js
@ -405,9 +405,12 @@ tape('rrp', function (t) {
|
|||||||
txt: 'baz.bar.com'
|
txt: 'baz.bar.com'
|
||||||
})
|
})
|
||||||
testEncoder(t, packet.rp, {
|
testEncoder(t, packet.rp, {
|
||||||
mbox: 'rp.world.com',
|
mbox: 'foo.bar.com'
|
||||||
txt: '.'
|
|
||||||
})
|
})
|
||||||
|
testEncoder(t, packet.rp, {
|
||||||
|
txt: 'baz.bar.com'
|
||||||
|
})
|
||||||
|
testEncoder(t, packet.rp, {})
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user