diff --git a/server.js b/server.js index 4f14995..9622d61 100644 --- a/server.js +++ b/server.js @@ -895,9 +895,14 @@ const server = http.createServer(async (req, res) => { } if (p === '/api/zone/seen' && (req.method === 'GET' || req.method === 'POST')) { await zones.seen(u.searchParams.get('i'), req); res.writeHead(204, { 'Access-Control-Allow-Origin': '*' }); return res.end(); } { const zm = /^\/api\/zone\/click\/([a-f0-9]{12})$/.exec(p); if (zm && req.method === 'GET') { const target = await zones.click(zm[1]); res.writeHead(302, { Location: target || '/', 'Cache-Control': 'no-store', 'Referrer-Policy': 'no-referrer-when-downgrade' }); return res.end(); } } - { const wm = /^\/welcome\/([a-f0-9]{48})$/.exec(p); if (wm && req.method === 'GET') { // one-time tester sign-in link + { const wm = /^\/welcome\/([a-f0-9]{48})$/.exec(p); if (wm && (req.method === 'GET' || req.method === 'POST')) { // one-time tester sign-in link const t = inviteTokens.get(wm[1]); if (!t || t.exp < Date.now()) { inviteTokens.delete(wm[1]); res.writeHead(410, { 'Content-Type': 'text/html; charset=utf-8' }); return res.end('
That sign-in link was already used or has expired. Ask for a fresh one.
'); } + // GET only shows a button: link-preview fetchers and in-app browsers prefetch links, and a prefetch must not spend the token + if (req.method === 'GET') { + res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'no-store', 'X-Robots-Tag': 'noindex' }); + return res.end('