我想为其中一个helmet.js
中间件设置一些自定义选项,但我不明白这样做是否启用了其他中间件,或者我必须明确启用它们?
来自helmet.js
文档:
// Sets all of the defaults, but overrides `script-src` and disables the default `style-src`
app.use(
helmet.contentSecurityPolicy({
useDefaults: true,
directives: {
"script-src": ["'self'", "example.com"],
"style-src": null,
},
})
);
我应该app.use(helmet())
在上面的代码之前添加吗?