fix ctx.ip
need tests for this
This commit is contained in:
parent
b1e5e6c6d4
commit
93f1bce66f
2 changed files with 13 additions and 1 deletions
|
@ -307,7 +307,7 @@ Request.prototype = {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
get ip() {
|
get ip() {
|
||||||
return this.ips[0] || this.connection.remoteAddress;
|
return this.ips[0] || this.socket.remoteAddress;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -42,6 +42,18 @@ function Response(ctx){
|
||||||
|
|
||||||
Response.prototype = {
|
Response.prototype = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the request socket.
|
||||||
|
*
|
||||||
|
* @return {Connection}
|
||||||
|
* @api public
|
||||||
|
*/
|
||||||
|
|
||||||
|
get socket() {
|
||||||
|
// TODO: TLS
|
||||||
|
return this.ctx.req.socket;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return response header.
|
* Return response header.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue