diff options
author | jaubourg <j@ubourg.net> | 2011-01-26 01:36:05 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-01-26 01:36:05 +0100 |
commit | 0e5b341cc0f3f9bf0f6659e09704f2267cfdfdba (patch) | |
tree | c592fede824012dc08e101e9ee175bec94f90c46 /test/unit/ajax.js | |
parent | 325dcdc2ab05173f809b9d83af59918b3695cc23 (diff) | |
download | jquery-0e5b341cc0f3f9bf0f6659e09704f2267cfdfdba.tar.gz jquery-0e5b341cc0f3f9bf0f6659e09704f2267cfdfdba.zip |
Fixes #5856. Adds document protocol at the beginning of URLs without protocol (thanks go to skrings for the initial pull request). Simplifies cross-domain detection regexp and logic as a consequence. Also took the opportunity to remove an unused variable. Unit test added.
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r-- | test/unit/ajax.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index abe90c88e..2624b5583 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -415,6 +415,18 @@ test(".ajax() - contentType" , function() { }); +test(".ajax() - protocol-less urls", function() { + expect(1); + + jQuery.ajax({ + url: "//somedomain.com", + beforeSend: function( xhr, settings ) { + equals(settings.url, location.protocol + "//somedomain.com", "Make sure that the protocol is added."); + return false; + } + }); +}); + test(".ajax() - hash", function() { expect(3); |