add additional node.js aliases

master
Jonathan Ong 2013-10-23 23:54:07 -07:00
parent fbfeffa090
commit f961647377
1 changed files with 54 additions and 3 deletions

View File

@ -110,7 +110,7 @@ module.exports = {
get status() {
return this.res.statusCode;
},
get statusCode() {
return this.res.statusCode;
},
@ -134,7 +134,7 @@ module.exports = {
var noContent = 304 == this.status || 204 == this.status;
if (noContent && this.body) this.body = null;
},
set statusCode(val) {
this.status = val;
},
@ -614,7 +614,7 @@ module.exports = {
get headerSent() {
return this.res.headersSent;
},
get headersSent() {
return this.res.headersSent;
},
@ -896,6 +896,57 @@ module.exports = {
}
},
setHeader: function(field, val){
this.set(field, val);
},
/**
* Get the current response header `name`.
*
* @param {String} name
* @api public
*/
getHeader: function(name){
return this.res.getHeader(name);
},
/**
* Remove the current response header `name`.
*
* @param {String} name
* @api public
*/
removeHeader: function(name){
return this.res.removeHeader(name);
},
/**
* Get the trailing headers to a request.
*
* @param {Object}
* @api public
*/
get trailers() {
return this.req.trailers;
},
/**
* Add trailing headers to the response.
*
* Maybe:
* - throw if not chunked encoding
*
* @param {object} headers
* @api public
*/
addTrailers: function(headers){
return this.res.addTrailers(headers);
},
/**
* Append `val` to header `field`.
*