potential bugfix for TXT records splitting after whitespace#18
potential bugfix for TXT records splitting after whitespace#18lastarel wants to merge 1 commit intoStephanGeorg:masterfrom
Conversation
|
Hi @lastarel Thank you for the PR. Could you please write a test for your scenario so I can review your changes? |
|
Hi, Not really sure what you refer to by a test as I've commented above pre-post the responses received. As to not make another commit with a simple test you can run this test : |
|
This bugfix uses joins(' ') to re-combine the improperly split TXT record by the previous line.split(/\s+/g). This does not work for a train of consecutive whitespaces inside the TXT record. |
Hi,
For TXT records that can have whitespaces such as:
SPF records:
IE: "v=spf1 include:_spf.google.com ~all"
Prior to commit this would've been parsed as:
dig(['google.com','TXT']).then((res)=>{
console.log(res.answer)
})
{
domain: 'google.com.',
type: 'TXT',
ttl: '3591',
class: 'IN',
value: '~all"'
},
Post commit:
dig(['google.com','TXT']).then((res)=>{
console.log(res.answer)
})
{
domain: 'google.com.',
type: 'TXT',
ttl: '3561',
class: 'IN',
value: '"v=spf1 include:_spf.google.com ~all"'
},