docs(context): update link (#1354)

* docs(context): update link

* docs(response): add code highlight
This commit is contained in:
Peng Jie 2019-07-30 14:06:19 +08:00 committed by Yiyu He
parent 52a673703a
commit 219bf22237
2 changed files with 2 additions and 2 deletions

View file

@ -87,7 +87,7 @@ Koa uses the [cookies](https://github.com/pillarjs/cookies) module where options
- `httpOnly` server-accessible cookie, __true__ by default - `httpOnly` server-accessible cookie, __true__ by default
- `overwrite` a boolean indicating whether to overwrite previously set cookies of the same name (__false__ by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie. - `overwrite` a boolean indicating whether to overwrite previously set cookies of the same name (__false__ by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie.
Koa uses the [cookies](https://github.com/jed/cookies) module where options are simply passed. Koa uses the [cookies](https://github.com/pillarjs/cookies) module where options are simply passed.
### ctx.throw([status], [msg], [properties]) ### ctx.throw([status], [msg], [properties])

View file

@ -126,7 +126,7 @@ If `response.status` has not been set, Koa will automatically set the status to
Koa doesn't guard against everything that could be put as a response body -- a function doesn't serialise meaningfully, returning a boolean may make sense based on your application, and while an error works, it may not work as intended as some properties of an error are not enumerable. We recommend adding middleware in your app that asserts body types per app. A sample middleware might be: Koa doesn't guard against everything that could be put as a response body -- a function doesn't serialise meaningfully, returning a boolean may make sense based on your application, and while an error works, it may not work as intended as some properties of an error are not enumerable. We recommend adding middleware in your app that asserts body types per app. A sample middleware might be:
``` ```js
app.use(async (ctx, next) => { app.use(async (ctx, next) => {
await next() await next()