Skip to content

Commit

Permalink
Merge pull request #181 from tekkamanendless/fix-txt-resolution
Browse files Browse the repository at this point in the history
This fixes TXT resolution by combining broken-up TXT records
  • Loading branch information
Mzack9999 committed May 2, 2024
2 parents 1b7ccd7 + acc8565 commit a6d47e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,9 @@ func (d *DNSData) ParseFromRR(rrs []dns.RR) error {
case *dns.CAA:
d.CAA = append(d.CAA, trimChars(recordType.Value))
case *dns.TXT:
for _, txt := range recordType.Txt {
d.TXT = append(d.TXT, trimChars(txt))
}
// Per RFC 7208, a single TXT record can be broken up into multiple parts and "MUST be treated as if those strings are concatenated
// together without adding spaces"; see: https://www.rfc-editor.org/rfc/rfc7208
d.TXT = append(d.TXT, strings.Join(recordType.Txt, ""))
case *dns.SRV:
d.SRV = append(d.SRV, trimChars(recordType.Target))
case *dns.AAAA:
Expand Down

0 comments on commit a6d47e7

Please sign in to comment.