fix ctx.ip

need tests for this
This commit is contained in:
TJ Holowaychuk 2013-11-13 13:17:16 -08:00
parent b1e5e6c6d4
commit 93f1bce66f
2 changed files with 13 additions and 1 deletions

View file

@ -307,7 +307,7 @@ Request.prototype = {
*/
get ip() {
return this.ips[0] || this.connection.remoteAddress;
return this.ips[0] || this.socket.remoteAddress;
},
/**

View file

@ -42,6 +42,18 @@ function Response(ctx){
Response.prototype = {
/**
* Return the request socket.
*
* @return {Connection}
* @api public
*/
get socket() {
// TODO: TLS
return this.ctx.req.socket;
},
/**
* Return response header.
*