From bb15cd682fdd686a51ec510b6a5a05b1a277f9ac Mon Sep 17 00:00:00 2001 From: Marco Collovati Date: Mon, 9 Dec 2024 07:48:24 +0100 Subject: [PATCH] fix: prevent generated pwa icons to be added to manifest Generated PWA icons are served at runtime by PwaHandler, that also takes care of adding a subset of them to the web manifest for caching. However, the Vite inject-manifest-to-sw plugin adds all generated icons to the manifest with /pwa-icons path prefix making them pre-cached by the browser and potentially breaking pre-defined security rules. This change prevents generated icons to be added to the manifest, preserving the previous behavior. --- flow-server/src/main/resources/vite.generated.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow-server/src/main/resources/vite.generated.ts b/flow-server/src/main/resources/vite.generated.ts index 7d323d8a9bc..1a64fa340c4 100644 --- a/flow-server/src/main/resources/vite.generated.ts +++ b/flow-server/src/main/resources/vite.generated.ts @@ -106,7 +106,7 @@ function injectManifestToSWPlugin(): rollup.Plugin { const { manifestEntries } = await getManifest({ globDirectory: buildOutputFolder, globPatterns: ['**/*'], - globIgnores: ['**/*.br'], + globIgnores: ['**/*.br', 'pwa-icons/**'], manifestTransforms: [rewriteManifestIndexHtmlUrl], maximumFileSizeToCacheInBytes: 100 * 1024 * 1024 // 100mb, });