Skip to content

Commit e2c31e4

Browse files
committed
fix: allow Dropbox dropins in CSP directives
Signed-off-by: Max Wu <[email protected]>
1 parent 118b11a commit e2c31e4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/csp.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ var defaultDirectives = {
1616
connectSrc: ['*']
1717
}
1818

19+
var dropboxDirectives = {
20+
scriptSrc: ['https://www.dropbox.com']
21+
}
22+
1923
var cdnDirectives = {
2024
scriptSrc: ['https://cdnjs.cloudflare.com', 'https://cdn.jsdelivr.net', 'https://cdn.mathjax.org'],
2125
styleSrc: ['https://cdnjs.cloudflare.com', 'https://cdn.jsdelivr.net', 'https://fonts.googleapis.com'],
@@ -37,6 +41,7 @@ CspStrategy.computeDirectives = function () {
3741
mergeDirectives(directives, config.csp.directives)
3842
mergeDirectivesIf(config.csp.addDefaults, directives, defaultDirectives)
3943
mergeDirectivesIf(config.useCDN, directives, cdnDirectives)
44+
mergeDirectivesIf(config.dropbox.appKey, directives, dropboxDirectives)
4045
mergeDirectivesIf(config.csp.addDisqus, directives, disqusDirectives)
4146
mergeDirectivesIf(config.csp.addGoogleAnalytics, directives, googleAnalyticsDirectives)
4247
if (!areAllInlineScriptsAllowed(directives)) {

0 commit comments

Comments
 (0)