Skip to content

Commit

Permalink
Updated syntax for helment csp
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-goodwin committed Mar 14, 2016
1 parent a5e67c5 commit dd364f3
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions td/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ app.use(helmet.noSniff());
app.use(helmet.xssFilter());
// can't currently use CSP as i would like because various 3rd party libs are using inline style and javascript eval()
app.use(helmet.csp({
defaultSrc: ["'none'"],
scriptSrc: ["'self'", "'unsafe-eval'"], //needed for lodash and nools
connectSrc: ["'self'"],
styleSrc: ["'self'", 'http://fonts.googleapis.com', 'https://fonts.googleapis.com', "'unsafe-inline'"], //needed for jquery
imgSrc: ["'self'", 'data:'],
fontSrc: ["'self'", 'http://fonts.gstatic.com', 'https://fonts.gstatic.com'],
formAction: ["'self'"],
reportUri: 'https://report-uri.io/report/owaspthreatdragon'
directives: {
defaultSrc: ["'none'"],
scriptSrc: ["'self'", "'unsafe-eval'"], //needed for lodash and nools
connectSrc: ["'self'"],
styleSrc: ["'self'", 'http://fonts.googleapis.com', 'https://fonts.googleapis.com', "'unsafe-inline'"], //needed for jquery
imgSrc: ["'self'", 'data:'],
fontSrc: ["'self'", 'http://fonts.gstatic.com', 'https://fonts.gstatic.com'],
formAction: ["'self'"],
reportUri: 'https://report-uri.io/report/owaspthreatdragon'
}
}));

//static content
Expand Down

0 comments on commit dd364f3

Please sign in to comment.