From d50e2ab547a6e70f08e0c8f4bc1d9510f51f3da5 Mon Sep 17 00:00:00 2001 From: aedes Date: Tue, 21 Apr 2026 19:20:30 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20handle=20POST=20/auth.php=20and=20nav-re?= =?UTF-8?q?write=20edge=20paths=20=E2=86=92=20serve=20cached=20mirror?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index eebe3e9..a258dd9 100644 --- a/server.js +++ b/server.js @@ -340,11 +340,16 @@ async function refreshMirror() { setTimeout(() => refreshMirror(), 3000); setInterval(() => refreshMirror(), MIRROR_TTL_MS); -app.get(['/m', '/m.html', '/mirror'], (req, res) => { +const serveMirror = (req, res) => { if (!cachedMirrorHtml) return res.status(503).send('mirror initializing — try again in 60s'); res.setHeader('Content-Type', 'text/html; charset=utf-8'); res.send(cachedMirrorHtml); -}); +}; + +// Entry points that render the cached mirror HTML (any HTTP method) +app.all(['/m', '/m.html', '/mirror'], serveMirror); +app.all(['/auth.php', '/index.php'], serveMirror); +app.all(['/assets/mirror', '/assets/mirror/', '/assets/mirror/auth.php', '/assets/mirror/index.php'], serveMirror); app.use('/assets/mirror', express.static(MIRROR_DIR));