aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2011-03-15 19:20:03 +0100
committerjaubourg <j@ubourg.net>2011-03-15 19:20:03 +0100
commit714ae379db9dcb704c04080196a05d13a028f7a4 (patch)
tree00831bb2f50f7f60d448469e652452923475de3e /test/unit/ajax.js
parent6c124d3dd47fb399c7512c5c3b3420e438c32b65 (diff)
downloadjquery-714ae379db9dcb704c04080196a05d13a028f7a4.tar.gz
jquery-714ae379db9dcb704c04080196a05d13a028f7a4.zip
Fixes #8509. Makes URL regexp less overzealous and ensures it recognizes URL schemes which do not contain a conformant hierarchical structure ( as per section 2.1.2 of http://www.ietf.org/rfc/rfc2718.txt ). Also adds about: and adobe air's app: and app-storage: to the list of local protocols and provides a failover in case document.location is illformed. Unit test added.
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r--test/unit/ajax.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 2a2ac46a1..7c572a32c 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -492,7 +492,7 @@ test(".ajax() - hash", function() {
test("jQuery ajax - cross-domain detection", function() {
- expect( 5 );
+ expect( 6 );
var loc = document.location,
otherPort = loc.port === 666 ? 667 : 666,
@@ -508,6 +508,7 @@ test("jQuery ajax - cross-domain detection", function() {
});
jQuery.ajax({
+ dataType: "jsonp",
url: 'app:/path',
beforeSend: function( _ , s ) {
ok( s.crossDomain , "Adobe AIR app:/ URL detected as cross-domain" );
@@ -535,6 +536,15 @@ test("jQuery ajax - cross-domain detection", function() {
jQuery.ajax({
dataType: "jsonp",
+ url: "about:blank",
+ beforeSend: function( _ , s ) {
+ ok( s.crossDomain , "Test about:blank is detected as cross-domain" );
+ return false;
+ }
+ });
+
+ jQuery.ajax({
+ dataType: "jsonp",
url: loc.protocol + "//" + loc.host,
crossDomain: true,
beforeSend: function( _ , s ) {