Merge branch 'master' of github.com:koajs/koa
This commit is contained in:
commit
0ae852be03
1 changed files with 5 additions and 6 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Context
|
||||
|
||||
A Koa Context encapsulates node's `request` and `response` objects
|
||||
|
@ -96,7 +95,7 @@
|
|||
|
||||
- `signed` the cookie requested should be signed
|
||||
|
||||
Note: koa uses the [cookies](https://github.com/jed/cookies) module where options are simply passed.
|
||||
Note: koa uses the [cookies](https://github.com/jed/cookies) module where options are simply passed.
|
||||
|
||||
### ctx.cookies.set(name, value, [options])
|
||||
|
||||
|
@ -109,13 +108,13 @@
|
|||
- `secure` secure cookie
|
||||
- `httpOnly` server-accessible cookie, __true__ by default
|
||||
|
||||
Note: koa uses the [cookies](https://github.com/jed/cookies) module where options are simply passed.
|
||||
Note: koa uses the [cookies](https://github.com/jed/cookies) module where options are simply passed.
|
||||
|
||||
### ctx.throw(msg, [status])
|
||||
|
||||
Helper method to throw an error with a `.status` property
|
||||
that will allow Koa to respond appropriately. The following
|
||||
combinations are allowed:
|
||||
defaulting to `500` that will allow Koa to respond appropriately.
|
||||
The following combinations are allowed:
|
||||
|
||||
```js
|
||||
this.throw(403)
|
||||
|
@ -135,4 +134,4 @@ throw err;
|
|||
`err.expose` meaning the messages are appropriate for
|
||||
client responses, which is typically not the case for
|
||||
error messages since you do not want to leak failure
|
||||
details.
|
||||
details.
|
||||
|
|
Loading…
Reference in a new issue