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>
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 72 KiB |
@@ -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>');
|
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 === '/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(); }
|
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);
|
if (/\.(mp4|webm)$/i.test(f)) return sendMedia(req, res, f);
|
||||||
return sendFile(res, f);
|
return sendFile(res, f);
|
||||||
|
|||||||