Helmet — Security · NestJS

A dozen response headers that tell browsers what not to do with your responses, set once by helmet on every response the API sends, with one directive adjusted for the shelter's image CDN.

What you will learn

Read the theory for Helmet

All Security lessons

All NestJS courses

loading types…

What you'll learn

  • Explain what security response headers do: instructions to the browser, enforced by the browser, that cost the server nothing
  • Register helmet as the first global middleware so every response, including errors and 404s, carries its headers
  • Read the headers helmet sets by default and name the ones that matter for a JSON API
  • Adjust one content security policy directive without losing the others, and turn a header off when it must be