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
@@ -36,7 +36,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/admin.js?v=2"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
</body>
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/contract.js?v=1"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
</body>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="card"><h2>Your decision</h2><p>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.</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=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/static.js?v=1"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/static.js?v=1"></script>
|
||||
<script src="https://polhunter.com/embed.js" data-slots="4" data-selector="main.wrap > .card" async></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/splash.js?v=3"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
<div class="card" id="pastCard" hidden><h2>Past winners</h2><p class="muted small">Paid in POL from the prize wallet at the POL price at payout time. Every payment is a public Polygon transaction.</p><div class="past" id="past"></div></div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/leaders.js?v=3"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/ledger.js?v=1"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/wallet.js?v=2"></script>
|
||||
<script src="/assets/buy.js?v=1"></script>
|
||||
<script src="/assets/my.js?v=3"></script>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<div class="card center"><p>Every network member (InstantAdPay or LinkSpin) also gets one free post credit each day they sign in.</p><a class="btn sec" href="/my">Use my free credit</a></div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/wallet.js?v=2"></script>
|
||||
<script src="/assets/buy.js?v=1"></script>
|
||||
<script src="/assets/packages.js?v=1"></script>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
<div class="card"><h2>Your choices</h2><p>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.</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=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/static.js?v=1"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
<div id="status" class="note" hidden></div>
|
||||
<div id="kit"><p class="muted">Loading the kit...</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/kitpage.js?v=2"></script>
|
||||
<script src="/assets/promote.js?v=1"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></script>
|
||||
|
||||
+1
-1
@@ -40,7 +40,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 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.</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=8"></script>
|
||||
<script src="/assets/common.js?v=9"></script>
|
||||
<script src="/assets/static.js?v=1"></script>
|
||||
<script src="/assets/chat.js?v=2" defer></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