Merge pull request #2945 from dojineko/hotfix-csp

Fix unnecessary shallow-copy
This commit is contained in:
Clark Du 2018-03-05 10:11:25 +08:00 committed by GitHub
commit a6b8fe565a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,7 @@ module.exports = async function nuxtMiddleware(req, res, next) {
if (this.options.render.csp && this.options.render.csp.enabled) {
const allowedSources = this.options.render.csp.allowedSources
const policies = this.options.render.csp.policies ? {...this.options.render.csp.policies} : null
const policies = this.options.render.csp.policies
let cspStr = `script-src 'self' ${(cspScriptSrcHashes).join(' ')}`
if (Array.isArray(allowedSources)) {
// For compatible section