Unverified Commit c0bb1bc8 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Fix incorrect example in headers and rewrites docs (#27652)

x-ref: https://github.com/vercel/next.js/issues/22660#issuecomment-890400273

## Documentation / Examples

- [x] Make sure the linting passes
parent 34d418c1
......@@ -166,13 +166,17 @@ The following characters `(`, `)`, `{`, `}`, `:`, `*`, `+`, `?` are used for reg
```js
module.exports = {
async redirects() {
async headers() {
return [
{
// this will match `/english(default)/something` being requested
source: '/english\\(default\\)/:slug',
destination: '/en-us/:slug',
permanent: false,
headers: [
{
key: 'x-header',
value: 'value',
},
],
},
]
},
......
......@@ -203,13 +203,12 @@ The following characters `(`, `)`, `{`, `}`, `:`, `*`, `+`, `?` are used for reg
```js
module.exports = {
async redirects() {
async rewrites() {
return [
{
// this will match `/english(default)/something` being requested
source: '/english\\(default\\)/:slug',
destination: '/en-us/:slug',
permanent: false,
},
]
},
......
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