Question · Vibe coding with Claude Code course · Module 15: Advanced Claude Code

Quiz: Security headers in next.config.ts

How do you add security headers in a project created by create-next-app?

Answer options

  • In a new next.config.js file with module.exports, because that is how the examples in the documentation look
  • In the .env.local file as NEXT_PUBLIC_ variables, so that the browser can read them
  • In the existing next.config.ts: async headers() in the nextConfig object exported with export default, and then curl -sI on the built application
  • In meta tags in app/layout.tsx, because then the browser gets them together with the page

You can check the correct answer by solving this task in the CodeWorlds game.