One address (Marty 2026-11-13): www. and new. redirect 301 to downlinebanners.com (SITE_HOST), path and query kept

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-13 08:34:52 -06:00
parent 289fcaf2c8
commit 34ffe2eb78
+3
View File
@@ -171,6 +171,9 @@ networksso.init({ self: 'bannerline', peer: 'iap', peerBase: () => C.iapBase, fr
const server = http.createServer(async (req, res) => {
const u = new URL(req.url, 'http://x'); const p = u.pathname;
// one address (Marty 2026-11-13: downlinebanners.com, not a subdomain): www. and new. move to the main domain, path and query kept
{ const host = String(req.headers.host || '').toLowerCase().split(':')[0];
if (C.isProd && host !== C.site && /(^|\.)downlinebanners\.com$/.test(host)) { res.writeHead(301, { Location: 'https://' + C.site + req.url, 'Cache-Control': 'no-store' }); return res.end(); } }
try {
// visitor cookie (used for rate limits only)
const ck = cookies(req); const setVid = !ck['bl.vid'] && !isBot(req) ? cookie('bl.vid', crypto.randomBytes(9).toString('hex'), 365 * 86400, true) : null;