mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
30 lines
819 B
JavaScript
30 lines
819 B
JavaScript
const helmet = require('helmet');
|
|
|
|
module.exports = function(config) {
|
|
if (config.enableHelmet) {
|
|
return helmet({
|
|
contentSecurityPolicy: {
|
|
directives: {
|
|
defaultSrc: [
|
|
"'self'",
|
|
'fonts.googleapis.com',
|
|
'fonts.gstatic.com',
|
|
'data:',
|
|
'gravatar.com',
|
|
],
|
|
styleSrc: [
|
|
"'self'",
|
|
"'unsafe-inline'",
|
|
'fonts.googleapis.com',
|
|
'fonts.gstatic.com',
|
|
'data:',
|
|
],
|
|
},
|
|
},
|
|
});
|
|
}
|
|
return (req, res, next) => {
|
|
next();
|
|
};
|
|
};
|