Merge pull request #1394 from hedgedoc/remove-cdn

This commit is contained in:
David Mehren 2021-08-15 20:11:26 +02:00 committed by GitHub
commit 957d7d553e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 70 additions and 244 deletions

View file

@ -27,7 +27,6 @@ describe('Content security policies', function () {
upgradeInsecureRequests: 'auto',
reportURI: undefined
},
useCDN: true,
dropbox: {
appKey: undefined
}
@ -44,21 +43,6 @@ describe('Content security policies', function () {
csp = mock.reRequire('../lib/csp')
})
// beginnging Tests
it('Disable CDN', function () {
const testconfig = defaultConfig
testconfig.useCDN = false
mock('../lib/config', testconfig)
csp = mock.reRequire('../lib/csp')
assert(!csp.computeDirectives().scriptSrc.includes('https://cdnjs.cloudflare.com'))
assert(!csp.computeDirectives().scriptSrc.includes('https://cdn.mathjax.org'))
assert(!csp.computeDirectives().styleSrc.includes('https://cdnjs.cloudflare.com'))
assert(!csp.computeDirectives().styleSrc.includes('https://fonts.googleapis.com'))
assert(!csp.computeDirectives().fontSrc.includes('https://cdnjs.cloudflare.com'))
assert(!csp.computeDirectives().fontSrc.includes('https://fonts.gstatic.com'))
})
it('Disable Google Analytics', function () {
const testconfig = defaultConfig
testconfig.csp.addGoogleAnalytics = false