From c0bb1bc82cc1fb93a932af26e2e280d75f3fe096 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Sat, 31 Jul 2021 16:53:47 -0500 Subject: [PATCH] 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 --- docs/api-reference/next.config.js/headers.md | 10 +++++++--- docs/api-reference/next.config.js/rewrites.md | 3 +-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/api-reference/next.config.js/headers.md b/docs/api-reference/next.config.js/headers.md index e467d7363af11..d64c01c676b79 100644 --- a/docs/api-reference/next.config.js/headers.md +++ b/docs/api-reference/next.config.js/headers.md @@ -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', + }, + ], }, ] }, diff --git a/docs/api-reference/next.config.js/rewrites.md b/docs/api-reference/next.config.js/rewrites.md index 1b557175db052..46c58eb6035dd 100644 --- a/docs/api-reference/next.config.js/rewrites.md +++ b/docs/api-reference/next.config.js/rewrites.md @@ -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, }, ] },