Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

Commit

Permalink
Adding NSEC test case for now. NSEC encoder is a bit off as you need …
Browse files Browse the repository at this point in the history
…to specifc the options in the data dict
  • Loading branch information
Supereg committed May 22, 2020
1 parent 8b89810 commit 39eb7d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,7 @@ answer.decode = function (buf, offset) {
a.data = enc.decode(buf, offset + 8)
offset += 8 + enc.decode.bytes

// TODO maybe make this an config option?
a.rawData = buf.slice(offset - enc.decode.bytes, offset) // we need the raw buffer for simultaneous probe tiebreaking
}

Expand Down
12 changes: 12 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,18 @@ tape('response', function (t) {
}]
})

testEncoder(t, packet, {
type: 'response',
answers: [{
type: 'NSEC',
name: 'nsectest.local',
data: {
nextDomain: 'a.domain',
rrtypes: ['A', 'TXT', 'RRSIG']
}
}]
})

t.end()
})

Expand Down

0 comments on commit 39eb7d4

Please sign in to comment.