Skip to content

Commit

Permalink
Add module.exports to security headers documentation (#26466)
Browse files Browse the repository at this point in the history
Without `module.exports`, the provided code won't work if just pasted into `next.config.js`

## Documentation / Examples

- [x] Make sure the linting passes
  • Loading branch information
samrobbins85 authored Jun 22, 2021
1 parent 562640d commit fc67fc7
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions docs/advanced-features/security-headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
// after learning more below.
const securityHeaders = [];

async headers() {
return [
{
// Apply these headers to all routes in your application.
source: '/(.*)',
headers: securityHeaders
}
]
const securityHeaders = []

module.exports = {
async headers() {
return [
{
// Apply these headers to all routes in your application.
source: '/(.*)',
headers: securityHeaders,
},
]
},
}
```

Expand Down

0 comments on commit fc67fc7

Please sign in to comment.