Commit 7d89d3c0 authored by jaubourg's avatar jaubourg

Fixes crossDomain test so that it assumes port to be 80 for http and 443 for...

Fixes crossDomain test so that it assumes port to be 80 for http and 443 for https when it is not provided.
parent 1cecfa1e
...@@ -317,6 +317,7 @@ jQuery.extend({ ...@@ -317,6 +317,7 @@ jQuery.extend({
timeoutTimer, timeoutTimer,
// Cross-domain detection vars // Cross-domain detection vars
loc = document.location, loc = document.location,
protocol = loc.protocol || "http:",
parts, parts,
// The jXHR state // The jXHR state
state = 0, state = 0,
...@@ -629,9 +630,10 @@ jQuery.extend({ ...@@ -629,9 +630,10 @@ jQuery.extend({
parts = rurl.exec( s.url.toLowerCase() ); parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( s.crossDomain = !!(
parts && parts &&
( parts[ 1 ] && parts[ 1 ] != loc.protocol || ( parts[ 1 ] && parts[ 1 ] != protocol ||
parts[ 2 ] != loc.hostname || parts[ 2 ] != loc.hostname ||
( parts[ 3 ] || 80 ) != ( loc.port || 80 ) ) ( parts[ 3 ] || ( ( parts[ 1 ] || protocol ) === "http:" ? 80 : 443 ) )
!= ( loc.port || ( protocol === "http:" ? 80 : 443 ) ) )
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment