Skip to content

Commit

Permalink
docs: Update the version history in the middleware page (#41949)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
nuta authored Oct 27, 2022
1 parent 288144c commit 882f338
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/advanced-features/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 882f338

Please sign in to comment.