mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
update test
This commit is contained in:
parent
4fb644fdb3
commit
2899212040
@ -26,7 +26,10 @@ test.serial('Init Nuxt.js', async t => {
|
|||||||
render: {
|
render: {
|
||||||
csp: {
|
csp: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
allowedSources: ['https://example.com', 'https://example.io']
|
policies: {
|
||||||
|
'default-src': [`'none'`],
|
||||||
|
'script-src': ['https://example.com', 'https://example.io']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -258,6 +261,7 @@ test('Content-Security-Policy Header', async t => {
|
|||||||
resolveWithFullResponse: true
|
resolveWithFullResponse: true
|
||||||
})
|
})
|
||||||
// Verify functionality
|
// Verify functionality
|
||||||
|
t.regex(headers['content-security-policy'], /default-src 'none'/)
|
||||||
t.regex(headers['content-security-policy'], /script-src 'self' 'sha256-.*'/)
|
t.regex(headers['content-security-policy'], /script-src 'self' 'sha256-.*'/)
|
||||||
t.true(headers['content-security-policy'].includes('https://example.com'))
|
t.true(headers['content-security-policy'].includes('https://example.com'))
|
||||||
t.true(headers['content-security-policy'].includes('https://example.io'))
|
t.true(headers['content-security-policy'].includes('https://example.io'))
|
||||||
|
Loading…
Reference in New Issue
Block a user