From d1f6ec02f99d47add42b581f37fda91b50442a9f Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 13 Jan 2022 21:12:27 -0800 Subject: [PATCH 1/2] Clarify `headers` config option description Reading over this page, it wasn't immediately clear to me if these were headers which would get read off of the incoming request, or headers to be added to the outgoing response. --- docs/api-reference/next.config.js/headers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-reference/next.config.js/headers.md b/docs/api-reference/next.config.js/headers.md index 7ac83a2b52298..a0a0719bc94d0 100644 --- a/docs/api-reference/next.config.js/headers.md +++ b/docs/api-reference/next.config.js/headers.md @@ -21,7 +21,7 @@ description: Add custom HTTP headers to your Next.js app. -Headers allow you to set custom HTTP headers for an incoming request path. +Headers allow you to set custom HTTP headers on the response to an incoming request on a given path. To set custom HTTP headers you can use the `headers` key in `next.config.js`: @@ -50,7 +50,7 @@ module.exports = { `headers` is an async function that expects an array to be returned holding objects with `source` and `headers` properties: - `source` is the incoming request path pattern. -- `headers` is an array of header objects with the `key` and `value` properties. +- `headers` is an array of headers to add to the response - each header is an object with `key` and `value` properties. - `basePath`: `false` or `undefined` - if false the basePath won't be included when matching, can be used for external rewrites only. - `locale`: `false` or `undefined` - whether the locale should not be included when matching. - `has` is an array of [has objects](#header-cookie-and-query-matching) with the `type`, `key` and `value` properties. From d168e4793348d130473e43a058a1902a9739cd6d Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 24 Jan 2022 15:55:07 -0800 Subject: [PATCH 2/2] apply code review suggestion --- docs/api-reference/next.config.js/headers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-reference/next.config.js/headers.md b/docs/api-reference/next.config.js/headers.md index a0a0719bc94d0..8ca39d02580b3 100644 --- a/docs/api-reference/next.config.js/headers.md +++ b/docs/api-reference/next.config.js/headers.md @@ -50,7 +50,7 @@ module.exports = { `headers` is an async function that expects an array to be returned holding objects with `source` and `headers` properties: - `source` is the incoming request path pattern. -- `headers` is an array of headers to add to the response - each header is an object with `key` and `value` properties. +- `headers` is an array of response header objects, with `key` and `value` properties. - `basePath`: `false` or `undefined` - if false the basePath won't be included when matching, can be used for external rewrites only. - `locale`: `false` or `undefined` - whether the locale should not be included when matching. - `has` is an array of [has objects](#header-cookie-and-query-matching) with the `type`, `key` and `value` properties.