Skip to content

Commit 5e55c51

Browse files
committed
refactor: update CSP for Netlify
1 parent e2ce434 commit 5e55c51

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

inst/templates/netlify.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ for = "/*"
1717
# - `connect-src data:` is required for asciinema (asciicast)
1818
# - `connect-src https://t.counter.dev` is required for counter.dev analytics
1919
# - `object-src 'self';` has to be set to enable PDF preview in Chrome
20-
# - `img-src https://deepwiki.com` has to be set for the DeepWiki badge in the README
21-
# - `img-src https://github.com` has to be set for the `R CMD check` badge in the README
22-
# - `img-src https://r-pkg.org` has to be set for the CRAN badge in the README
20+
# - `img-src ...` have to be set for badges in the README
2321
# - `script-src 'unsafe-eval'` is required for MathJax, cf. https://github.com/mathjax/MathJax/issues/1988#issuecomment-384978927
2422
# - `script-src https://rpkg.dev` is required for counter.dev analytics
2523
# - `style-src 'unsafe-inline'` is required for MathJax, cf. https://github.com/mathjax/MathJax/issues/1988#issuecomment-581567775
@@ -29,7 +27,7 @@ Content-Security-Policy = '''
2927
default-src 'none';
3028
connect-src 'self' data: https://t.counter.dev;
3129
font-src 'self';
32-
img-src 'self' data: https://deepwiki.com https://github.com https://r-pkg.org;
30+
img-src 'self' data: https://github.com https://r-pkg.org https://rpkg.dev;
3331
manifest-src 'self';
3432
object-src 'self';
3533
script-src 'self' 'unsafe-eval' https://rpkg.dev;

netlify.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ for = "/*"
1717
# - `connect-src data:` is required for asciinema (asciicast)
1818
# - `connect-src https://t.counter.dev` is required for counter.dev analytics
1919
# - `object-src 'self';` has to be set to enable PDF preview in Chrome
20-
# - `img-src https://deepwiki.com` has to be set for the DeepWiki badge in the README
21-
# - `img-src https://github.com` has to be set for the `R CMD check` badge in the README
22-
# - `img-src https://r-pkg.org` has to be set for the CRAN badge in the README
20+
# - `img-src ...` have to be set for badges in the README
2321
# - `script-src 'unsafe-eval'` is required for MathJax, cf. https://github.com/mathjax/MathJax/issues/1988#issuecomment-384978927
2422
# - `script-src https://rpkg.dev` is required for counter.dev analytics
2523
# - `style-src 'unsafe-inline'` is required for MathJax, cf. https://github.com/mathjax/MathJax/issues/1988#issuecomment-581567775
@@ -29,7 +27,7 @@ Content-Security-Policy = '''
2927
default-src 'none';
3028
connect-src 'self' data: https://t.counter.dev;
3129
font-src 'self';
32-
img-src 'self' data: https://deepwiki.com https://github.com https://r-pkg.org;
30+
img-src 'self' data: https://github.com https://r-pkg.org https://rpkg.dev;
3331
manifest-src 'self';
3432
object-src 'self';
3533
script-src 'self' 'unsafe-eval' https://rpkg.dev;

0 commit comments

Comments
 (0)