Fix #12637: restore 1.8.1 ajax crossDomain logic. Close gh-944.

This commit is contained in:
Richard Gibson
2012-10-03 08:26:01 -04:00
committed by Dave Methvin
parent ebf4d43011
commit da3ff3afe4
2 changed files with 17 additions and 4 deletions

View File

@@ -511,12 +511,22 @@ test(".ajax() - hash", function() {
test("jQuery ajax - cross-domain detection", function() {
expect( 6 );
expect( 7 );
var loc = document.location,
samePort = loc.port || ( loc.protocol === "http:" ? 80 : 443 ),
otherPort = loc.port === 666 ? 667 : 666,
otherProtocol = loc.protocol === "http:" ? "https:" : "http:";
jQuery.ajax({
dataType: "jsonp",
url: loc.protocol + "//" + loc.host + ":" + samePort,
beforeSend: function( _ , s ) {
ok( !s.crossDomain , "Test matching ports are not detected as cross-domain" );
return false;
}
});
jQuery.ajax({
dataType: "jsonp",
url: otherProtocol + "//" + loc.host,