Never cache HTML (no-store) so wallet browsers can't serve stale pages
Trust's in-app browser was serving a cached pre-fix HTML page that pointed at old JS, re-triggering the numeric-chainId crash even after the fix shipped. Switch HTML from no-cache to no-store so every load fetches the current page and its current asset versions. Versioned assets still cache for an hour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -177,7 +177,10 @@ function sendFile(res, file) {
|
|||||||
if (err) { res.writeHead(404, baseHeaders({ 'Content-Type': 'text/plain' })); return res.end('Not found'); }
|
if (err) { res.writeHead(404, baseHeaders({ 'Content-Type': 'text/plain' })); return res.end('Not found'); }
|
||||||
const ext = path.extname(file).toLowerCase();
|
const ext = path.extname(file).toLowerCase();
|
||||||
res.writeHead(200, baseHeaders({ 'Content-Type': MIME[ext] || 'application/octet-stream',
|
res.writeHead(200, baseHeaders({ 'Content-Type': MIME[ext] || 'application/octet-stream',
|
||||||
'Cache-Control': ext === '.html' ? 'no-cache' : 'public, max-age=3600' }));
|
// HTML is never stored (so a fresh load always gets the current asset
|
||||||
|
// versions — aggressive in-app wallet browsers were serving stale pages
|
||||||
|
// that pointed at old, since-fixed JS); versioned assets cache for an hour.
|
||||||
|
'Cache-Control': ext === '.html' ? 'no-store, must-revalidate' : 'public, max-age=3600' }));
|
||||||
res.end(data);
|
res.end(data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user