Skip to content

Commit

Permalink
fix(csp): adds font and blob src to whitelist
Browse files Browse the repository at this point in the history
Adds font and blob sources to the CSP whitelist.
  • Loading branch information
jniles committed Aug 3, 2020
1 parent ea1b067 commit 629cae3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ exports.configure = function configure(app) {
debug('configuring middleware.');

// helmet guards
app.use(helmet({ contentSecurityPolicy : { directives : { defaultSrc : ['\'self\'', '\'unsafe-inline\''] } } }));
app.use(helmet({
contentSecurityPolicy : {
directives : {
defaultSrc : ['\'self\'', '\'unsafe-inline\'', 'blob:'],
fontSrc : ['\'self\'', '\'https://fonts.gstatic.com\''],
},
},
}));

app.use(bodyParser.json({ limit : '8mb' }));
app.use(bodyParser.urlencoded({ extended : false }));
Expand Down

0 comments on commit 629cae3

Please sign in to comment.