add additional node.js aliases

This commit is contained in:
Jonathan Ong 2013-10-23 23:54:07 -07:00
parent fbfeffa090
commit f961647377

View file

@ -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`. * Append `val` to header `field`.
* *