Skip to content

Commit

Permalink
add res.get(field) to node/client
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Feb 19, 2013
1 parent 35c764f commit 1dbbc0a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/client.js
Expand Up @@ -278,6 +278,18 @@ function Response(xhr, options) {
this.body = this.parseBody(this.text);
}

/**
* Get case-insensitive `field` value.
*
* @param {String} field
* @return {String}
* @api public
*/

Response.prototype.get = function(field){
return this.header[field.toLowerCase()];
};

/**
* Set header related properties:
*
Expand Down
12 changes: 12 additions & 0 deletions lib/node/response.js
Expand Up @@ -52,6 +52,18 @@ function Response(req, res, options) {

Response.prototype.__proto__ = Stream.prototype;

/**
* Get case-insensitive `field` value.
*
* @param {String} field
* @return {String}
* @api public
*/

Response.prototype.get = function(field){
return this.header[field.toLowerCase()];
};

/**
* Implements methods of a `ReadableStream`
*/
Expand Down

0 comments on commit 1dbbc0a

Please sign in to comment.