Skip to content

Commit 14e9da5

Browse files
committed
A quick change to detect AIR urls
1 parent 58faec7 commit 14e9da5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/ajax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var r20 = /%20/g,
1919
rucHeadersFunc = function( _, $1, $2 ) {
2020
return $1 + $2.toUpperCase();
2121
},
22-
rurl = /^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,
22+
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?|\/[^\/])/,
2323

2424
// Keep a copy of the old load method
2525
_load = jQuery.fn.load,

test/unit/ajax.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,6 +2239,18 @@ test("jQuery.ajax - active counter", function() {
22392239
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
22402240
});
22412241

2242+
test("jQuery.ajax - compatible with AIR urls"), function() {
2243+
expect( 1 );
2244+
stop();
2245+
$.ajax({
2246+
url: "app:/testing",
2247+
beforeSend: function() {
2248+
ok( this.crossDomain, "Detected crossDomain for AIR Url" );
2249+
return false;
2250+
}
2251+
});
2252+
});
2253+
22422254
}
22432255

22442256
//}

0 commit comments

Comments
 (0)