Skip to content

Commit

Permalink
Removed req.isXMLHttpRequest
Browse files Browse the repository at this point in the history
let me know if you actually use this :)
  • Loading branch information
tj committed Nov 9, 2011
1 parent 801a179 commit af46df7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,18 +360,14 @@ req.__defineGetter__('stale', function(){
return connect.utils.modified(this, this.res);
});

// Callback for isXMLHttpRequest / xhr

function isxhr() {
return this.header('X-Requested-With', '').toLowerCase() === 'xmlhttprequest';
}

/**
* Check if the request was an _XMLHttpRequest_.
*
* @return {Boolean}
* @api public
*/

req.__defineGetter__('isXMLHttpRequest', isxhr);
req.__defineGetter__('xhr', isxhr);
req.__defineGetter__('xhr', function(){
return this.header('X-Requested-With', '')
.toLowerCase() == 'xmlhttprequest';
});

0 comments on commit af46df7

Please sign in to comment.