Skip to content

Commit

Permalink
feat: CSP 'font-src' tweak (add 'data:') (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
rentallect authored Nov 20, 2024
1 parent 5151296 commit 4d8decd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ZitiFirstStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ class ZitiFirstStrategy extends CacheFirst /* NetworkFirst */ {
origCSP['img-src'].push(`*`);
}

if (origCSP['font-src']) {
if (!origCSP['font-src'].includes("data:")) {
origCSP['font-src'].push("data:");
}
}

let directives:any = {}
if (!isUndefined(origCSP['child-src'])) { directives.childSrc = origCSP['child-src'];}
if (!isUndefined(origCSP['connect-src'])) { directives.connectSrc = origCSP['connect-src'];}
Expand Down

0 comments on commit 4d8decd

Please sign in to comment.