mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
Add test for dropbox csp rule
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
3115c472fb
commit
c2c28d3aeb
1 changed files with 10 additions and 0 deletions
10
test/csp.js
10
test/csp.js
|
@ -81,6 +81,16 @@ describe('Content security policies', function () {
|
|||
assert(!csp.computeDirectives().fontSrc.includes('https://*.disquscdn.com'))
|
||||
})
|
||||
|
||||
it('Include dropbox if configured', function () {
|
||||
let testconfig = defaultConfig
|
||||
testconfig.dropbox.appKey = 'hedgedoc'
|
||||
mock('../lib/config', testconfig)
|
||||
csp = mock.reRequire('../lib/csp')
|
||||
|
||||
assert(csp.computeDirectives().scriptSrc.includes('https://www.dropbox.com'))
|
||||
assert(csp.computeDirectives().scriptSrc.includes('\'unsafe-inline\''))
|
||||
})
|
||||
|
||||
it('Set ReportURI', function () {
|
||||
let testconfig = defaultConfig
|
||||
testconfig.csp.reportURI = 'https://example.com/reportURI'
|
||||
|
|
Loading…
Reference in a new issue