Add missing error manifest entry and fix lint (#37758)
* Add missing error manifest entry * fix lint * guid -> guide
This commit is contained in:
parent
eb55af1cfe
commit
97395b4cd6
2 changed files with 7 additions and 2 deletions
|
@ -4,6 +4,10 @@
|
|||
"title": "Messages",
|
||||
"heading": true,
|
||||
"routes": [
|
||||
{
|
||||
"title": "middleware-upgrade-guide",
|
||||
"path": "/errors/middleware-upgrade-guide.md"
|
||||
},
|
||||
{
|
||||
"title": "react-hydration-error",
|
||||
"path": "/errors/react-hydration-error.md"
|
||||
|
|
|
@ -209,7 +209,7 @@ export function middleware() {
|
|||
response.cookies.set('nextjs', 'awesome', { path: '/test' })
|
||||
|
||||
// get all the details of a cookie
|
||||
const {value, options} = response.cookies.getWithOptions('vercel')
|
||||
const { value, options } = response.cookies.getWithOptions('vercel')
|
||||
console.log(value) // => 'fast'
|
||||
console.log(options) // => { Path: '/test' }
|
||||
|
||||
|
@ -220,6 +220,7 @@ export function middleware() {
|
|||
response.cookies.clear()
|
||||
}
|
||||
```
|
||||
|
||||
## New User-Agent Helper
|
||||
|
||||
### Summary of changes
|
||||
|
@ -229,7 +230,7 @@ export function middleware() {
|
|||
|
||||
### Explanation
|
||||
|
||||
To help reduce the size of your Middleware, we have extracted the user agent from the request object and created a new helper `userAgent`.
|
||||
To help reduce the size of your Middleware, we have extracted the user agent from the request object and created a new helper `userAgent`.
|
||||
|
||||
The helper is imported from `next/server` and allows you to opt in to using the user agent. The helper gives you access to the same properties that were available from the request object.
|
||||
|
||||
|
|
Loading…
Reference in a new issue