mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Fix #12637: restore 1.8.1 ajax crossDomain logic. Close gh-944.
This commit is contained in:
committed by
Dave Methvin
parent
ebf4d43011
commit
da3ff3afe4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user