From 4f2bd2542621d19b64fab7f5fa6ee61c28bf5d09 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 19 Jun 2026 02:31:57 +0200 Subject: [PATCH] revert(byse): drop the v3.3.78 truncated-host rejection (added cost, no benefit) v3.3.78 rejected upload-server hosts ending in the bare ".filemoon" label so the lookup would retry for a valid server. In practice byse is currently returning a truncated host for its WHOLE pool, so the rejection found nothing to fall back to and turned every byse upload into a slow "Kein Upload-Server erhalten: OK" (6x2.5s server retry per file) instead of the fast ENOTFOUND fail it had before. That is a worse UX with zero upside while byse is down, so revert to the v3.3.77 behavior. The premise (byse returns a MIX of good and truncated hosts, skip the bad ones) is unverified; the evidence is byse returning truncated hosts for everything. And the correct upload domain is NOT safely determinable from outside: a swarm of filemoon-brand TLDs resolve (filemoon.eu/.me/.xyz/.art/.nl, kerapoxy.cc, moonmov.pro, ...) but the ones probed are parked/squatted (parklogic landers, shared catch-all certs), and byse's real response is only visible with a valid key. Guessing a TLD would point uploads at a parking page or a third party, so we do not. lib/hosters.js is now byte-identical to v3.3.77. The v3.3.77 fixes (5xx/ECONNRESET treated as transient -> no failover cascade/blacklist; the /api/file/list path fix) are kept. ENOTFOUND remains transient, so byse's outage fails clean (retry same account, no cascade) with the actual unresolvable host shown in the message. Suite 311/311. When byse restores its server pool (returns complete hostnames), uploads resume automatically with no client change. Co-Authored-By: Claude Opus 4.8 (1M context) --- lib/hosters.js | 2 -- tests/hosters.test.js | 13 ------------- 2 files changed, 15 deletions(-) diff --git a/lib/hosters.js b/lib/hosters.js index b28c981..1069243 100644 --- a/lib/hosters.js +++ b/lib/hosters.js @@ -8,7 +8,6 @@ const API_TIMEOUT = 45000; // 45 seconds const SERVER_RETRY_ATTEMPTS = 6; const SERVER_RETRY_DELAY_MS = 2500; const LAST_UPLOAD_SERVERS = new Map(); -const TRUNCATED_UPLOAD_HOST = /(^|\.)filemoon$/i; function appendRawQuery(url, rawQuery) { const parsed = new URL(url); @@ -80,7 +79,6 @@ function normalizeAbsoluteUrl(raw, apiBase) { try { const parsed = new URL(candidate); if (!['http:', 'https:'].includes(parsed.protocol)) return null; - if (TRUNCATED_UPLOAD_HOST.test(parsed.hostname)) return null; return parsed.href; } catch { return null; diff --git a/tests/hosters.test.js b/tests/hosters.test.js index 56b8ba5..9f41eef 100644 --- a/tests/hosters.test.js +++ b/tests/hosters.test.js @@ -32,19 +32,6 @@ describe('hosters helpers', () => { assert.equal(url, 'https://delivery-hydra.voe-network.net/upload/01'); }); - it('rejects byse truncated upload hosts (TLD dropped) so the lookup retries for a valid server', () => { - assert.equal(__test.extractUploadServerUrl({ result: 'https://s1065.filemoon/upload/01' }, 'https://api.byse.sx'), null); - assert.equal(__test.extractUploadServerUrl({ result: 's1070.filemoon' }, 'https://api.byse.sx'), null); - assert.equal(__test.extractUploadServerUrl({ result: 'https://filemoon/upload/01' }, 'https://api.byse.sx'), null); - }); - - it('keeps a complete byse upload host (real TLD present) untouched', () => { - assert.equal( - __test.extractUploadServerUrl({ result: 'https://s1065.filemoon.sx/upload/01' }, 'https://api.byse.sx'), - 'https://s1065.filemoon.sx/upload/01' - ); - }); - it('parseDoodstreamResult tolerates null/non-object payload without throwing', () => { // Direct callers may bypass uploadFile's normalisation. The parser must // never throw on bad input — empty fields are the contract.