Files

1.5 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
587d8249367417b2b2512c40 Configurar o Helmet usando o middleware 'pai' helmet() 2 301575 configure-helmet-using-the-parent-helmet-middleware

--description--

Lembrando que este projeto está sendo construído a partir do Replit, ou pose ser clonado no GitHub.

app.use(helmet()) incluirá automaticamente todo o middleware apresentado acima, exceto noCache() e contentSecurityPolicy(), mas estes podem ser habilitados, se necessário. Você também pode desativar ou configurar qualquer outro middleware individualmente, usando um objeto de configuração.

Exemplo:

app.use(helmet({
  frameguard: {         // configure
    action: 'deny'
  },
  contentSecurityPolicy: {    // enable and configure
    directives: {
      defaultSrc: ["'self'"],
      styleSrc: ['style.com'],
    }
  },
  dnsPrefetchControl: false     // disable
}))

Apresentamos cada middleware separadamente para fins didáticos e para facilitar os testes. Usar o middleware 'pai' helmet() é de fácil implementação em um projeto real.

--hints--

sem testes - esse é um desafio descritivo

assert(true);

--solutions--

/**
  Backend challenges don't need solutions, 
  because they would need to be tested against a full working project. 
  Please check our contributing guidelines to learn more.
*/