Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed req.isXMLHttpRequest

let me know if you actually use this :)
  • Loading branch information...
commit af46df7eaea3e5687e483d0aeceb250d14f10aa3 1 parent 801a179
@tj tj authored
Showing with 4 additions and 8 deletions.
  1. +4 −8 lib/request.js
View
12 lib/request.js
@@ -360,12 +360,6 @@ 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_.
*
@@ -373,5 +367,7 @@ function isxhr() {
* @api public
*/
-req.__defineGetter__('isXMLHttpRequest', isxhr);
-req.__defineGetter__('xhr', isxhr);
+req.__defineGetter__('xhr', function(){
+ return this.header('X-Requested-With', '')
+ .toLowerCase() == 'xmlhttprequest';
+});
Please sign in to comment.
Something went wrong with that request. Please try again.