Serve the old site's /images/ banner files: Network Ad Space ads still hotlink them (ad 236 showed a broken banner on startworkingforyou.com, Marty 2026-11-19)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-19 07:46:59 -06:00
parent 444b08ddac
commit 8804a3cd69
8 changed files with 1 additions and 1 deletions
+1 -1
View File
@@ -263,7 +263,7 @@ const server = http.createServer(async (req, res) => {
return res.end('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' + urls + '</urlset>');
}
if (p === '/robots.txt') { res.writeHead(200, headers({ 'Content-Type': 'text/plain; charset=utf-8' })); return res.end(C.staging ? 'User-agent: *\nDisallow: /\n' : 'User-agent: *\nAllow: /\nDisallow: /my\nDisallow: /admin\nDisallow: /api/\nDisallow: /go/\nDisallow: /sso/\nDisallow: /s/\n\nSitemap: https://' + C.site + '/sitemap.xml\n'); }
if (p.startsWith('/assets/') || p.startsWith('/art/') || p === '/favicon.ico') {
if (p.startsWith('/assets/') || p.startsWith('/art/') || p.startsWith('/images/') || p === '/favicon.ico') { // /images/ = the old site's banner files, still hotlinked by Network Ad Space ads (2026-11-19)
const f = path.normalize(path.join(PUB, p === '/favicon.ico' ? '/art/icon-192.png' : p)); if (!f.startsWith(PUB + path.sep)) { res.writeHead(400); return res.end(); }
if (/\.(mp4|webm)$/i.test(f)) return sendMedia(req, res, f);
return sendFile(res, f);