Skip to content

Commit

Permalink
Add integrity to preload headers
Browse files Browse the repository at this point in the history
  • Loading branch information
lemonmade committed Feb 19, 2025
1 parent 13ab1fc commit 0312ff0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-pears-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@quilted/assets': patch
---

Add integrity to preload headers
5 changes: 5 additions & 0 deletions packages/assets/source/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function preloadHeader(attributes: Partial<HTMLLinkElement>) {
href,
crossOrigin,
crossorigin,
integrity,
} = attributes as any;

// Support both property and attribute versions of the casing
Expand All @@ -32,5 +33,9 @@ export function preloadHeader(attributes: Partial<HTMLLinkElement>) {
header += `; crossorigin="${finalCrossOrigin}"`;
}

if (integrity) {
header += `; integrity="${integrity}"`;
}

return header;
}

0 comments on commit 0312ff0

Please sign in to comment.