diff --git a/src/libs/httpserver/httpServerProvider.tsx b/src/libs/httpserver/httpServerProvider.tsx index 7fae1d7c7..27a087a90 100644 --- a/src/libs/httpserver/httpServerProvider.tsx +++ b/src/libs/httpserver/httpServerProvider.tsx @@ -149,7 +149,7 @@ export const HttpServerProvider = ( } await setCookie(cookie, client) - const rawHtml = await getIndexForFqdnAndSlug(fqdn, slug) + const rawHtml = await getIndexForFqdnAndSlug(fqdn, slug, source) if (!rawHtml) { return { diff --git a/src/libs/httpserver/indexGenerator.ts b/src/libs/httpserver/indexGenerator.ts index a90ec0e3a..2f2486516 100644 --- a/src/libs/httpserver/indexGenerator.ts +++ b/src/libs/httpserver/indexGenerator.ts @@ -13,6 +13,7 @@ import { prepareAssets } from '/libs/httpserver/copyAllFilesFromBundleAssets' import { TemplateValues } from '/libs/httpserver/indexDataFetcher' +import { HtmlSource } from '/libs/httpserver/models' import { getCurrentAppConfigurationForFqdnAndSlug, setCurrentAppVersionForFqdnAndSlug @@ -87,11 +88,17 @@ const isSlugInBlocklist = (currentSlug: string): boolean => export const getIndexForFqdnAndSlug = async ( fqdn: string, - slug: string + slug: string, + source: HtmlSource ): Promise => { if (shouldDisableGetIndex()) return false // Make cozy-app hosted by webpack-dev-server work with HTTPServer - if (!isSlugInAllowlist(slug) || isSlugInBlocklist(slug)) return false + if ( + (!isSlugInAllowlist(slug) || isSlugInBlocklist(slug)) && + source !== 'cache' + ) { + return false + } await initLocalBundleIfNotExist(fqdn, slug)