Scanner and rotator accept bare domains (scheme added for them); clearer scanner error

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-07 16:27:17 -05:00
parent 27b3727a9f
commit 75d95d84d6
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ function init(opts) { DATA_DIR = opts.dataDir; geo = opts.geo || null; OWN_HOSTS
const norm = e => String(e || '').trim().toLowerCase();
const newCode = () => { const a = 'abcdefghjkmnpqrstuvwxyz23456789'; let s = ''; for (let i = 0; i < 6; i++) s += a[crypto.randomInt(a.length)]; return s; };
const BOT = /bot|crawl|spider|slurp|facebookexternalhit|preview|telegrambot|whatsapp|curl|wget|python-requests|headless/i;
const cleanUrl = u => { const s = String(u || '').trim(); return /^https?:\/\/[^\s]+$/i.test(s) && s.length <= 500 ? s : null; };
const cleanUrl = u => { let s = String(u || '').trim(); if (s && !/^[a-z][a-z0-9+.-]*:\/\//i.test(s) && /^[^\s\/]+\.[^\s]+/.test(s)) s = 'https://' + s; return /^https?:\/\/[^\s]+$/i.test(s) && s.length <= 500 ? s : null; };
function pub(r) {
const hits = J.db.hits.filter(h => h.r === r.id);