mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
Required to support react-selct, see https://github.com/JedWatson/react-select/issues/2917
30 lines
817 B
JavaScript
30 lines
817 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'",
|
|
'fonts.googleapis.com',
|
|
'fonts.gstatic.com',
|
|
'data:',
|
|
'unsafe-inline',
|
|
],
|
|
},
|
|
},
|
|
});
|
|
}
|
|
return (req, res, next) => {
|
|
next();
|
|
};
|
|
};
|