fix: constrain PWA caching and extend font CSP
Quality / quality (ubuntu-latest) (push) Failing after 22s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-03 00:38:23 +05:30
parent b3e9b99e13
commit 649e3d9127
4 changed files with 47 additions and 3 deletions
+6 -2
View File
@@ -514,7 +514,8 @@ export async function loadAppConfig(appRoot: string, profile?: string): Promise<
/**
* Auto-extend the CSP so configured Google Fonts load under the default policy
* (their CSS host into `style-src`, the static host into `font-src`). No-op when
* (their CSS host into `style-src`, the static host into `font-src`, and the
* static host into `connect-src` for service-worker fetch interception). No-op when
* the app disabled CSP (`security.contentSecurityPolicy: false`) or uses no
* Google Fonts. Local (self-hosted) fonts are served from `'self'` and need nothing.
*/
@@ -532,7 +533,10 @@ function applyFontCsp(config: AppConfig): void {
dirs[name] = Array.from(new Set([...cur, ...adds]));
};
if (add.style.length) extend("style-src", ["'self'", "'unsafe-inline'"], add.style);
if (add.font.length) extend("font-src", ["'self'", "data:"], add.font);
if (add.font.length) {
extend("font-src", ["'self'", "data:"], add.font);
extend("connect-src", ["'self'", "ws:", "wss:"], add.font);
}
}
/**