From fc662661a84ce69121a2f69dc2ce8932f0578a82 Mon Sep 17 00:00:00 2001 From: Max Wu Date: Tue, 3 Mar 2020 18:35:48 +0800 Subject: [PATCH] fix: only enable dropbox directives when config is given Signed-off-by: Max Wu --- lib/csp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/csp.js b/lib/csp.js index 6ab7ea60..c87ca972 100644 --- a/lib/csp.js +++ b/lib/csp.js @@ -41,7 +41,7 @@ CspStrategy.computeDirectives = function () { mergeDirectives(directives, config.csp.directives) mergeDirectivesIf(config.csp.addDefaults, directives, defaultDirectives) mergeDirectivesIf(config.useCDN, directives, cdnDirectives) - mergeDirectivesIf(config.dropbox.appKey, directives, dropboxDirectives) + mergeDirectivesIf(config.dropbox && config.dropbox.appKey, directives, dropboxDirectives) mergeDirectivesIf(config.csp.addDisqus, directives, disqusDirectives) mergeDirectivesIf(config.csp.addGoogleAnalytics, directives, googleAnalyticsDirectives) if (!areAllInlineScriptsAllowed(directives)) {