diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bda580..fb6058c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### [1.0.2] - 2025-01-30 +- replace .replace(//g) with a replaceAll - prettier: move config into package.json - dep(eslint): upgrade to v9 - dep(all): bump versions diff --git a/index.js b/index.js index 18bb1c7..138e7c8 100644 --- a/index.js +++ b/index.js @@ -320,7 +320,7 @@ exports.big_company = function (next, connection, helo) { const allowed_rdns = this.cfg.bigco[helo].split(/,/) for (const allow of allowed_rdns) { - const re = new RegExp(`${allow.replace(/\./g, '\\.')}$`) + const re = new RegExp(`${allow.replaceAll('.', '\\.')}$`) if (re.test(rdns)) { connection.results.add(this, { pass: 'big_co' }) return next() diff --git a/test/index.js b/test/index.js index 006f14c..65a49da 100644 --- a/test/index.js +++ b/test/index.js @@ -334,8 +334,8 @@ describe('helo.checks', () => { beforeEach(_set_up) it('pass, reject=false', (t, done) => { - const test_helo = 'yahoo.com' - this.connection.remote.host = 'yahoo.com' + const test_helo = 'yahoo.co.jp' + this.connection.remote.host = 'yahoo.co.jp' this.plugin.cfg.check.big_company = true this.plugin.cfg.reject.big_company = true this.plugin.big_company(