From 4ea6e038e12a6a473b158e52800fb6a4d01becf3 Mon Sep 17 00:00:00 2001 From: martbost Date: Sun, 15 Nov 2026 14:15:06 -0600 Subject: [PATCH] Link check: safeLookup answers in the shape Node 20's https agent asks for (opts.all -> an array; every address checked for private ranges). Answering with one address made every probe fail as 'could not reach', so no text ad / banner link could be saved (Marty 2026-11-15). The status note scrolls into view when it shows (it sits at the foot of the page, so a refused post looked like a dead button). Smoke all green. Co-Authored-By: Claude Opus 5.5 --- public/admin.html | 2 +- public/assets/common.js | 2 +- public/contract.html | 2 +- public/disclaimer.html | 2 +- public/how.html | 2 +- public/index.html | 2 +- public/leaders.html | 2 +- public/ledger.html | 2 +- public/my.html | 2 +- public/packages.html | 2 +- public/privacy.html | 2 +- public/promote.html | 2 +- public/terms.html | 2 +- safety.js | 10 +++++++--- 14 files changed, 20 insertions(+), 16 deletions(-) diff --git a/public/admin.html b/public/admin.html index 5354d72..f50155d 100644 --- a/public/admin.html +++ b/public/admin.html @@ -36,7 +36,7 @@ - + diff --git a/public/assets/common.js b/public/assets/common.js index b1b8fa9..6e66b56 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -6,7 +6,7 @@ window.VBB = (function () { const getConfig = () => cfgP || (cfgP = fetch('/api/config').then(r => r.json())); const short = a => a ? a.slice(0, 6) + '...' + a.slice(-4) : ''; const framed = (() => { try { return window.top !== window.self; } catch (e) { return true; } })(); - function status(msg, cls) { const el = $('status'); if (!el) return; el.hidden = !msg; el.className = 'note ' + (cls || ''); el.textContent = msg || ''; } + function status(msg, cls) { const el = $('status'); if (!el) return; el.hidden = !msg; el.className = 'note ' + (cls || ''); el.textContent = msg || ''; if (msg) el.scrollIntoView({ block: 'nearest', behavior: 'smooth' }); } // the note sits at the foot of the page: bring it into view (2026-11-15, a failed post looked like a dead button) async function getJSON(url, opts) { const r = await fetch(url, opts); let j = {}; try { j = await r.json(); } catch (e) {} if (!r.ok && !j.error) j.error = 'Request failed (' + r.status + ')'; return j; } const post = (url, body) => getJSON(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body || {}) }); const n = x => Number(x || 0).toLocaleString('en-US'); diff --git a/public/contract.html b/public/contract.html index bb19aa1..3725635 100644 --- a/public/contract.html +++ b/public/contract.html @@ -50,7 +50,7 @@ - + diff --git a/public/disclaimer.html b/public/disclaimer.html index 91cd36f..707a8bc 100644 --- a/public/disclaimer.html +++ b/public/disclaimer.html @@ -34,7 +34,7 @@

Your decision

Only spend what you can afford to lose completely. This is not financial, legal or tax advice. You are responsible for any taxes on what you receive.

Contact

Questions, problems or a request about your data: network support, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.

- + diff --git a/public/how.html b/public/how.html index e3ccb0f..5b1eabd 100644 --- a/public/how.html +++ b/public/how.html @@ -55,7 +55,7 @@ - + diff --git a/public/index.html b/public/index.html index 53dcb54..aaefc59 100644 --- a/public/index.html +++ b/public/index.html @@ -56,7 +56,7 @@ - + diff --git a/public/leaders.html b/public/leaders.html index 2200b82..258bde8 100644 --- a/public/leaders.html +++ b/public/leaders.html @@ -33,7 +33,7 @@ - + diff --git a/public/ledger.html b/public/ledger.html index 51711dd..2a9b9fd 100644 --- a/public/ledger.html +++ b/public/ledger.html @@ -35,7 +35,7 @@ - + diff --git a/public/my.html b/public/my.html index 3387b89..ea1c636 100644 --- a/public/my.html +++ b/public/my.html @@ -78,7 +78,7 @@ - + diff --git a/public/packages.html b/public/packages.html index 64db3ff..39f1b6c 100644 --- a/public/packages.html +++ b/public/packages.html @@ -43,7 +43,7 @@

Every network member (InstantAdPay or LinkSpin) also gets one free post credit each day they sign in.

Use my free credit
- + diff --git a/public/privacy.html b/public/privacy.html index e240ea7..1b248fc 100644 --- a/public/privacy.html +++ b/public/privacy.html @@ -35,7 +35,7 @@

Your choices

You can ask us to delete your account data on this site or on the network hub. Records on the blockchain cannot be deleted by anyone. You can clear the cookies in your browser at any time; you will need to sign in again.

Contact

Questions, problems or a request about your data: network support, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.

- + diff --git a/public/promote.html b/public/promote.html index 38e869c..b890593 100644 --- a/public/promote.html +++ b/public/promote.html @@ -34,7 +34,7 @@

Loading the kit...

- + diff --git a/public/terms.html b/public/terms.html index 826c7f7..3139e18 100644 --- a/public/terms.html +++ b/public/terms.html @@ -40,7 +40,7 @@

Limits

As far as the law allows, we are not responsible for losses caused by the blockchain, your wallet, the price of POL, third-party websites in banners, or events outside our control, and our total responsibility to you is limited to what you paid for the purchase in question. These terms are governed by the laws of the State of Alabama, USA.

Contact

Questions, problems or a request about your data: network support, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.

- + diff --git a/safety.js b/safety.js index d995457..13d0fd9 100644 --- a/safety.js +++ b/safety.js @@ -69,11 +69,15 @@ function privateIp(ip) { if (s.startsWith('::ffff:')) return privateIp(s.slice(7)); return s === '::' || s === '::1' || s.startsWith('fc') || s.startsWith('fd') || s.startsWith('fe80') || s.startsWith('ff'); } +// Node 20's https agent asks for every address (opts.all, for happy eyeballs) and expects an array back; answering with one +// address broke every link check (2026-11-15: no text ad could be posted). Answer in the shape asked for, private ones refused. function safeLookup(host, opts, cb) { - dns.lookup(host, Object.assign({}, opts, { all: false }), (err, addr, fam) => { + if (typeof opts === 'function') { cb = opts; opts = {}; } + dns.lookup(host, Object.assign({}, opts, { all: true }), (err, list) => { if (err) return cb(err); - if (privateIp(addr)) return cb(new Error('private address')); - cb(null, addr, fam); + if (!list.length || list.some(a => privateIp(a.address))) return cb(new Error('private address')); + if (opts && opts.all) return cb(null, list); + cb(null, list[0].address, list[0].family); }); } // GET with a size cap, a timeout and no redirects followed (a redirect is reported so the caller can decide)