fix(gateway-ui): refresh service worker and static cache headers

This commit is contained in:
William Valentin
2026-02-18 12:22:01 -08:00
parent 68ce0f77c4
commit 805bbaead9
4 changed files with 52 additions and 11 deletions
+11
View File
@@ -295,6 +295,7 @@ describe('GatewayServer integration', () => {
const res = await fetch(`http://127.0.0.1:${TEST_PORT}/`);
expect(res.status).toBe(200);
expect(res.headers.get('content-type')).toBe('text/html');
expect(res.headers.get('cache-control')).toBe('no-cache');
const body = await res.text();
expect(body).toContain('Flynn');
});
@@ -308,6 +309,16 @@ describe('GatewayServer integration', () => {
expect(res.headers.get('content-type')).toBe('text/css');
});
it('serves sw.js with no-store cache policy', async () => {
if (!LISTEN_ALLOWED) {
return;
}
const res = await fetch(`http://127.0.0.1:${TEST_PORT}/sw.js`);
expect(res.status).toBe(200);
expect(res.headers.get('content-type')).toBe('application/javascript');
expect(res.headers.get('cache-control')).toBe('no-store');
});
it('returns 404 for unknown HTTP path', async () => {
if (!LISTEN_ALLOWED) {
return;