Unverified Commit fc67fc73 authored by Sam Robbins's avatar Sam Robbins Committed by GitHub

Add module.exports to security headers documentation (#26466)

Without `module.exports`, the provided code won't work if just pasted into `next.config.js`

## Documentation / Examples

- [x] Make sure the linting passes
parent 562640db
...@@ -11,16 +11,18 @@ To improve the security of your application, you can use [`headers`](/docs/api-r ...@@ -11,16 +11,18 @@ To improve the security of your application, you can use [`headers`](/docs/api-r
// You can choose which headers to add to the list // You can choose which headers to add to the list
// after learning more below. // after learning more below.
const securityHeaders = []; const securityHeaders = []
async headers() { module.exports = {
return [ async headers() {
{ return [
// Apply these headers to all routes in your application. {
source: '/(.*)', // Apply these headers to all routes in your application.
headers: securityHeaders source: '/(.*)',
} headers: securityHeaders,
] },
]
},
} }
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment