From 882f3380eef219432543e98393550f2ed65624dc Mon Sep 17 00:00:00 2001 From: Seiya Nuta Date: Fri, 28 Oct 2022 04:31:52 +0900 Subject: [PATCH] docs: Update the version history in the middleware page (#41949) Make it clear that only Next.js 13.0.0 or newer support setting request headers in a middleware. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) --- docs/advanced-features/middleware.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/advanced-features/middleware.md b/docs/advanced-features/middleware.md index 8b4e56a9c99dd..58d2f90fb4ad4 100644 --- a/docs/advanced-features/middleware.md +++ b/docs/advanced-features/middleware.md @@ -9,6 +9,7 @@ description: Learn how to use Middleware to run code before a request is complet | Version | Changes | | --------- | ------------------------------------------------------------------------------------------ | +| `v13.0.0` | Support overriding request headers. | | `v12.2.0` | Middleware is stable | | `v12.0.9` | Enforce absolute URLs in Edge Runtime ([PR](https://github.com/vercel/next.js/pull/33410)) | | `v12.0.0` | Middleware (Beta) added | @@ -188,7 +189,7 @@ export function middleware(request: NextRequest) { ## Setting Headers -You can set request and response headers using the `NextResponse` API. +You can set request and response headers using the `NextResponse` API (setting _request_ headers is available since Next.js v13.0.0). ```ts // middleware.ts