Improve Middleware Set Cookie API documentation (#31707)

This commit is contained in:
Maedah Batool 2021-11-30 03:44:58 +05:00 committed by GitHub
parent 7be75bbf2f
commit 2781b8eb87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,6 +63,7 @@ import type { NextFetchEvent } from 'next/server'
The `NextResponse` object is an extension of the native [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) interface, with the following added methods and properties:
- `cookies` - An object with the cookies in the `Response`
- `cookie` - Set a cookie in the `Response`
- `redirect()` - Returns a `NextResponse` with a redirect set
- `rewrite()` - Returns a `NextResponse` with a rewrite set
- `next()` - Returns a `NextResponse` that will continue the middleware chain