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.

This commit is contained in:
jaubourg 2011-01-26 01:36:05 +01:00
parent 325dcdc2ab
commit 0e5b341cc0
2 changed files with 20 additions and 11 deletions

View file

@ -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);