You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
})
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 : it('Should query TXT for spf.test.com and return a full valid value for spf', (done) => { dig(['spf.test.com', 'TXT']) .then((result) => { expect(result).to.be.an('object') .and.to.have.property('question') .and.to.be.an('array'); expect(result).to.have.property('answer') .and.to.be.an('array'); expect(result.answer[0].value).to.be.a('string') expect(result).to.have.property('time') .and.to.be.an('number'); expect(result).to.have.property('server') .and.to.be.an('string'); expect(result).to.have.property('datetime') .and.to.be.an('string'); expect(result).to.have.property('size') .and.to.be.an('number'); expect(result.answer[0].value).to.contain('v=spf1 ~all') expect(result.answer[0].type).to.equal("TXT") done(); }) .catch((err) => { console.log('Error:', err); }); });
It's a spin from your MX test so you can check the properties and values as well as the TXT return value.
Good luck hope it helps.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"'
},