driprunner.app is home: other hosts forward pages (path + query kept), API/callback/health/badges answer everywhere; preview images on the new domain
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -159,6 +159,12 @@ async function creditRefuel(intent, nonce, info) {
|
||||
// ---- server ------------------------------------------------------------------------------------
|
||||
const server = http.createServer(async (req, res) => {
|
||||
const u = new URL(req.url, 'http://x'); const p = u.pathname;
|
||||
// one home address (2026-10-01): pages on any other host we answer for (driprunner.saasy.top, www.) move to SITE_URL with the
|
||||
// path and query intact, so key links keep working and a refuel never returns to a different origin than the run started on.
|
||||
// The API, the IAP callback, health and the badge art answer on every host.
|
||||
{ const host = String(req.headers.host || '').toLowerCase().split(':')[0]; const home = SITE.replace(/^https?:\/\//, '').toLowerCase();
|
||||
if (IS_PROD && host && host !== home && req.method === 'GET' && !p.startsWith('/api/') && p !== '/health' && !p.startsWith('/badges/')) {
|
||||
res.writeHead(301, { Location: SITE + req.url, 'Cache-Control': 'no-store' }); return res.end(); } }
|
||||
try {
|
||||
if (p === '/health') return json(res, 200, { ok: true, outbound: outbound(), curtain: !!CURTAIN, sso: sso.enabled(), faucet: faucetOn, dryRun: faucet.dry(), chain: Number(process.env.DR_CHAIN_ID) || null, signups: String(process.env.DR_SIGNUPS || ledger.settings().signups) });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user