From a0f378773e0c0d32784613aa60b55d738cfacd1b Mon Sep 17 00:00:00 2001 From: Ayanwola Ayomide <77179231+devvspaces@users.noreply.github.com> Date: Thu, 3 Nov 2022 03:09:49 +0100 Subject: [PATCH] update middleware cookies example (#42341) in the example at ## Using Cookies, the first example, the cookie header assumption was wrong. It first confused me, before I knew it was meant to be `nextjs` instead. Thanks for building an amazing library ## 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 - [x] 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 - [ ] Make sure the linting passes by running `pnpm build && 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced-features/middleware.md b/docs/advanced-features/middleware.md index 85b463ce81345..b0f04aa0a5b17 100644 --- a/docs/advanced-features/middleware.md +++ b/docs/advanced-features/middleware.md @@ -160,7 +160,7 @@ import { NextResponse } from 'next/server' import type { NextRequest } from 'next/server' export function middleware(request: NextRequest) { - // Assume a "Cookie:vercel=fast" header to be present on the incoming request + // Assume a "Cookie:nextjs=fast" header to be present on the incoming request // Getting cookies from the request using the `RequestCookies` API const cookie = request.cookies.get('nextjs')?.value console.log(cookie) // => 'fast'