From bc3ba4686e66e113d765501a3f45779173077510 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Tue, 19 Nov 2024 11:40:38 +0000 Subject: [PATCH] chore: format --- CONTRIBUTORS.md | 4 ++-- lib/spf.js | 9 ++++++--- test/spf.js | 5 ++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 2ff5949..fbdff49 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,7 +2,7 @@ This handcrafted artisinal software is brought to you by: -|
msimerson (15)|
smfreegard (4)|
DoobleD (2)|
gramakri (1)|
ne4t0 (1)| -| :---: | :---: | :---: | :---: | :---: | +|
msimerson (15) |
smfreegard (4) |
DoobleD (2) |
gramakri (1) |
ne4t0 (1) | +| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | this file is maintained by [.release](https://github.com/msimerson/.release) diff --git a/lib/spf.js b/lib/spf.js index db0f3a2..58e8c35 100644 --- a/lib/spf.js +++ b/lib/spf.js @@ -362,7 +362,10 @@ class SPF { switch (result) { case this.SPF_PASS: // Store matching "include" mechanisms - this.spf_record_include_match = { ...this.spf_record_include_match, ...recurse.spf_record_include_match } + this.spf_record_include_match = { + ...this.spf_record_include_match, + ...recurse.spf_record_include_match, + } this.spf_record_include_match[domain] = recurse.spf_record return this.SPF_PASS case this.SPF_FAIL: @@ -512,7 +515,7 @@ class SPF { resolve_method = 'resolve6' } - let addrs = []; + let addrs = [] try { addrs = await dns[resolve_method](mx) } catch (err) { @@ -527,7 +530,7 @@ class SPF { } this.log_debug(`mech_mx: mx=${mx} addresses=${addrs?.join(',')}`) - addresses = addrs ? addrs.concat(addresses) : []; + addresses = addrs ? addrs.concat(addresses) : [] } if (!addresses.length) return this.SPF_NONE diff --git a/test/spf.js b/test/spf.js index f79241f..3709f18 100644 --- a/test/spf.js +++ b/test/spf.js @@ -112,6 +112,9 @@ describe('SPF', function () { this.timeout = 3000 this.SPF.count = 0 await this.SPF.check_host('130.211.0.1', 'google.com') - assert.ok(this.SPF.spf_record_include_match?.['_netblocks3.google.com'], 'expected include not found') + assert.ok( + this.SPF.spf_record_include_match?.['_netblocks3.google.com'], + 'expected include not found', + ) }) })