1.6 KiB
1.6 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d8249367417b2b2512c40 | Configure Helmet Using the ‘parent’ helmet() Middleware | 2 | 配置头盔使用“父”头盔()中间件 |
Description
app.use(helmet({
frameguard: { // configure
action: 'deny'
},
contentSecurityPolicy: { // enable and configure
directives: {
defaultSrc: ["self"],
styleSrc: ['style.com'],
}
},
dnsPrefetchControl: false // disable
}))
我们分别为教学目的引入了每个中间件,并且易于测试。使用“父”头盔()中间件对于真实项目来说是最简单,更清洁的。 Instructions
Tests
tests:
- text: 没有测试 - 这是一个描述性的挑战
testString: assert(true)
Challenge Seed
Solution
// solution required