fix(server): don't call getCspString when cspScriptSrcHashes is unavailable (#5474)

Co-Authored-By: Andreas Zoellner <andreaszoellner@gmail.com>
This commit is contained in:
pooya parsa 2019-04-07 13:32:32 +04:30
parent 7ec48c3af0
commit 2ca08a6bf3

View File

@ -69,7 +69,7 @@ export default ({ options, nuxt, renderRoute, resources }) => async function nux
}
}
if (options.render.csp) {
if (options.render.csp && cspScriptSrcHashes) {
const { allowedSources, policies } = options.render.csp
const cspHeader = options.render.csp.reportOnly ? 'Content-Security-Policy-Report-Only' : 'Content-Security-Policy'