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 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@
|
||||
<div class="card"><h3>Old site links</h3><p class="small">JSON file {"oldrefs": {"old username": "network username"}} replaces the whole map.</p><input type="file" id="oldFile" accept="application/json"><pre class="kit-pre" id="oldOut"></pre></div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/admin.js?v=6"></script>
|
||||
</body>
|
||||
|
||||
@@ -8,7 +8,7 @@ window.VAB = (function () {
|
||||
const short = a => a ? a.slice(0, 6) + '...' + a.slice(-4) : '';
|
||||
const framed = (() => { try { return window.top !== window.self; } catch (e) { return true; } })();
|
||||
const n = x => Number(x || 0).toLocaleString('en-US');
|
||||
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 + ')'; j._status = r.status; return j; }
|
||||
const post = (url, body) => getJSON(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body || {}) });
|
||||
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@
|
||||
</section>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/wallet.js?v=6"></script>
|
||||
<script src="/assets/buy.js?v=6"></script>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
</ol></div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/contract.js?v=6"></script>
|
||||
</body>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="card"><h2>Prices and taxes</h2><p>Boosts are priced in US dollars and paid in POL, whose price moves. Anything you receive is in POL and its dollar value can change. You are responsible for any taxes on what you receive where you live.</p></div>
|
||||
<div class="card"><h2>Who to ask</h2><p>TrustClickz, 615 Green Valley Drive, Moody, AL 35004. <a href="https://instantadpay.com/support" target="_blank" rel="noopener">Network support</a>.</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/static.js?v=6"></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@
|
||||
<p class="muted small">A Boost buys advertising, not income. Nothing is promised.</p>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/how.js?v=6"></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@
|
||||
<p class="muted small">A Boost buys advertising, not income. Nothing is promised.</p>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/front.js?v=6"></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
<p class="muted small">Levels follow the buyer's sponsor line. Someone who has not bought a Boost is passed over and their share goes up to the next person who has. Advertising, not income. Nothing is promised.</p>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/ledger.js?v=6"></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@
|
||||
<p class="muted small">Advertising, not income. Nothing is promised.</p>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/member.js?v=6"></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@
|
||||
</section>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/wallet.js?v=6"></script>
|
||||
<script src="/assets/my.js?v=6"></script>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
<div class="card"><h2>Your choices</h2><p>You can edit your ad at any time, or ask us to remove it and your account here. Records on the blockchain cannot be removed by anyone.</p></div>
|
||||
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/static.js?v=6"></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
<div id="status" class="note" hidden></div>
|
||||
<div id="kit" style="display:flex;flex-direction:column;gap:16px"><p class="muted">Loading the kit...</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/kitpage.js?v=6"></script>
|
||||
<script src="/assets/promote.js?v=6"></script>
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@
|
||||
<div class="card"><h2>Limits</h2><p>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 ads, 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.</p></div>
|
||||
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
<script src="/assets/static.js?v=6"></script>
|
||||
</body>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user