docs: add request.origin
This commit is contained in:
parent
1ed691dde3
commit
b2bcbcec7c
2 changed files with 10 additions and 0 deletions
|
@ -148,6 +148,7 @@ koa uses [http-assert](https://github.com/jshttp/http-assert) for assertions.
|
||||||
- `ctx.url`
|
- `ctx.url`
|
||||||
- `ctx.url=`
|
- `ctx.url=`
|
||||||
- `ctx.originalUrl`
|
- `ctx.originalUrl`
|
||||||
|
- `ctx.origin`
|
||||||
- `ctx.href`
|
- `ctx.href`
|
||||||
- `ctx.path`
|
- `ctx.path`
|
||||||
- `ctx.path=`
|
- `ctx.path=`
|
||||||
|
|
|
@ -39,6 +39,15 @@
|
||||||
|
|
||||||
Get request original URL.
|
Get request original URL.
|
||||||
|
|
||||||
|
### request.origin
|
||||||
|
|
||||||
|
Get origin of URL, include `protocol` and `host`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
this.request.origin
|
||||||
|
// => http://example.com
|
||||||
|
```
|
||||||
|
|
||||||
### request.href
|
### request.href
|
||||||
|
|
||||||
Get full request URL, include `protocol`, `host` and `url`.
|
Get full request URL, include `protocol`, `host` and `url`.
|
||||||
|
|
Loading…
Reference in a new issue