aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2011-01-19 18:35:40 +0100
committerjaubourg <j@ubourg.net>2011-01-19 18:35:40 +0100
commit7d89d3c07233f77437a0acf77b1adf7f2c17989f (patch)
tree0e31f3388f53efae4e1fec91fdc6315e6104adbf /src
parent1cecfa1ece0d48b253fb0775bba645c464e363a4 (diff)
downloadjquery-7d89d3c07233f77437a0acf77b1adf7f2c17989f.tar.gz
jquery-7d89d3c07233f77437a0acf77b1adf7f2c17989f.zip
Fixes crossDomain test so that it assumes port to be 80 for http and 443 for https when it is not provided.
Diffstat (limited to 'src')
-rw-r--r--src/ajax.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ajax.js b/src/ajax.js
index e5fb5c4bc..be31fe320 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -317,6 +317,7 @@ jQuery.extend({
timeoutTimer,
// Cross-domain detection vars
loc = document.location,
+ protocol = loc.protocol || "http:",
parts,
// The jXHR state
state = 0,
@@ -629,9 +630,10 @@ jQuery.extend({
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!(
parts &&
- ( parts[ 1 ] && parts[ 1 ] != loc.protocol ||
+ ( parts[ 1 ] && parts[ 1 ] != protocol ||
parts[ 2 ] != loc.hostname ||
- ( parts[ 3 ] || 80 ) != ( loc.port || 80 ) )
+ ( parts[ 3 ] || ( ( parts[ 1 ] || protocol ) === "http:" ? 80 : 443 ) )
+ != ( loc.port || ( protocol === "http:" ? 80 : 443 ) ) )
);
}