Closed zicklag closed 2 days ago
I validated that records in the authority section are required to comply with RFC 2308 Section 2.2.
Oh, I just found the packet.raw.authorities
:grinning:
That works, but we might want to setup a similar wrapper as we have for the answers and additionals.
Ah good catch, just forgot to implement that in the packet wrapper! Simple fix. Thanks for flagging!
For context (both for you and anyone else who happens to be browsing), the wrapper mostly exists for two reasons:
set
wrappers around the raw packet properties allow us to check for this.frozen
before allowing modifications and to throw the custom ModifiedAfterSentError
without implementing an arguably more complicated proxy.answers
property is arguably overly permissive with the answers that are allowed in the dns-packet
typings. Specifically, the OPT pseudo record type violates the interface that all other records have (it lacks a data
attribute), and TypeScript REALLY did not like plugins that tried to access the data
property of the answers array with OPT records in that interface. Indeed, the RFC seems to specify that OPT records may only be added "to the additional data section of a request". It actually looks like there's an open issue about this on the dns-packet
library, but that library is also distinct from the types which would have to be updated as well.Just closing the loop on this -- this was just deployed in version 0.0.12!
Packet type allows you to add answer and additional records, but it doesn't allow you to add authority records.
I think I might need this, but I haven't learned enough about DNS to know for sure yet, they might be optional.