Merge pull request #308 from llovvoll/fix/can-not-load-external-script
fix: can not load external script & Unable to get disqus config of shorname
This commit is contained in:
commit
008253470d
@ -16,7 +16,7 @@ const Disqus = ({ frontMatter }) => {
|
||||
}
|
||||
if (window.DISQUS === undefined) {
|
||||
const script = document.createElement('script')
|
||||
script.src = 'https://' + siteMetadata.comment.disqus.shortname + '.disqus.com/embed.js'
|
||||
script.src = 'https://' + siteMetadata.comment.disqusConfig.shortname + '.disqus.com/embed.js'
|
||||
script.setAttribute('data-timestamp', +new Date())
|
||||
script.setAttribute('crossorigin', 'anonymous')
|
||||
script.async = true
|
||||
|
@ -5,12 +5,13 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
||||
// You might need to insert additional domains in script-src if you are using external services
|
||||
const ContentSecurityPolicy = `
|
||||
default-src 'self';
|
||||
script-src 'self' 'unsafe-eval' 'unsafe-inline';
|
||||
script-src 'self' 'unsafe-eval' 'unsafe-inline' giscus.app;
|
||||
style-src 'self' 'unsafe-inline' *.googleapis.com cdn.jsdelivr.net;
|
||||
img-src * blob: data:;
|
||||
media-src 'none';
|
||||
connect-src *;
|
||||
font-src 'self' fonts.gstatic.com cdn.jsdelivr.net;
|
||||
frame-src giscus.app
|
||||
`
|
||||
|
||||
const securityHeaders = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user