diff --git a/@kindspells/astro-shield/package.json b/@kindspells/astro-shield/package.json index dfa8cfd..6df89a4 100644 --- a/@kindspells/astro-shield/package.json +++ b/@kindspells/astro-shield/package.json @@ -1,6 +1,6 @@ { "name": "@kindspells/astro-shield", - "version": "1.5.0", + "version": "1.5.1", "description": "Astro integration to enhance your website's security with SubResource Integrity hashes, Content-Security-Policy headers, and other techniques.", "private": false, "type": "module", diff --git a/@kindspells/astro-shield/src/core.mts b/@kindspells/astro-shield/src/core.mts index 06e94e9..bcc6b6f 100644 --- a/@kindspells/astro-shield/src/core.mts +++ b/@kindspells/astro-shield/src/core.mts @@ -753,17 +753,6 @@ export const processStaticFiles = async ( sri, ) - if (!sri.hashesModule) { - return - } - - await generateSRIHashesModule( - logger, - h, - sri.hashesModule, - sri.enableMiddleware, - ) - if (securityHeaders?.enableOnStaticPages !== undefined) { const provider = securityHeaders.enableOnStaticPages.provider switch (provider) { @@ -789,6 +778,15 @@ export const processStaticFiles = async ( exhaustiveGuard(provider, 'provider') } } + + if (sri.hashesModule) { + await generateSRIHashesModule( + logger, + h, + sri.hashesModule, + sri.enableMiddleware, + ) + } } export const getMiddlewareHandler = (