Skip to content

Commit ea3b3dd

Browse files
committed
fix: decouple netlify headers from hashesModule
Signed-off-by: Andres Correa Casablanca <andreu@kindspells.dev>
1 parent 0a9cd55 commit ea3b3dd

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

@kindspells/astro-shield/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kindspells/astro-shield",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Astro integration to enhance your website's security with SubResource Integrity hashes, Content-Security-Policy headers, and other techniques.",
55
"private": false,
66
"type": "module",

@kindspells/astro-shield/src/core.mts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -753,17 +753,6 @@ export const processStaticFiles = async (
753753
sri,
754754
)
755755

756-
if (!sri.hashesModule) {
757-
return
758-
}
759-
760-
await generateSRIHashesModule(
761-
logger,
762-
h,
763-
sri.hashesModule,
764-
sri.enableMiddleware,
765-
)
766-
767756
if (securityHeaders?.enableOnStaticPages !== undefined) {
768757
const provider = securityHeaders.enableOnStaticPages.provider
769758
switch (provider) {
@@ -789,6 +778,15 @@ export const processStaticFiles = async (
789778
exhaustiveGuard(provider, 'provider')
790779
}
791780
}
781+
782+
if (sri.hashesModule) {
783+
await generateSRIHashesModule(
784+
logger,
785+
h,
786+
sri.hashesModule,
787+
sri.enableMiddleware,
788+
)
789+
}
792790
}
793791

794792
export const getMiddlewareHandler = (

0 commit comments

Comments
 (0)