summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Mehren2020-09-02 20:17:57 +0200
committerGitHub2020-09-02 20:17:57 +0200
commitf862b7a1e44c1101a921f19bca4d8d8063eb25ce (patch)
treee1cb778962cffd1d0a216bf706adea8684df398c /lib
parentb174f3c574949e930cef1c652fb85604dc8ce482 (diff)
parentc2c28d3aeb4f3db92991bf77cd8e8dfa1be2268f (diff)
Merge pull request #485 from codimd/fix/dropbox
Diffstat (limited to '')
-rw-r--r--lib/csp.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/csp.js b/lib/csp.js
index fe8bea01..24399436 100644
--- a/lib/csp.js
+++ b/lib/csp.js
@@ -32,6 +32,10 @@ var googleAnalyticsDirectives = {
scriptSrc: ['https://www.google-analytics.com']
}
+var dropboxDirectives = {
+ scriptSrc: ['https://www.dropbox.com', '\'unsafe-inline\'']
+}
+
CspStrategy.computeDirectives = function () {
var directives = {}
mergeDirectives(directives, config.csp.directives)
@@ -39,6 +43,7 @@ CspStrategy.computeDirectives = function () {
mergeDirectivesIf(config.useCDN, directives, cdnDirectives)
mergeDirectivesIf(config.csp.addDisqus, directives, disqusDirectives)
mergeDirectivesIf(config.csp.addGoogleAnalytics, directives, googleAnalyticsDirectives)
+ mergeDirectivesIf(config.dropbox.appKey, directives, dropboxDirectives)
if (!areAllInlineScriptsAllowed(directives)) {
addInlineScriptExceptions(directives)
}