Fixed situation where there's a location.port but we're using https://, in which

case we want to do 443.
This commit is contained in:
Guillermo Rauch
2011-06-18 11:09:54 -03:00
parent b5e7e41a15
commit fe2ae1fa6c

View File

@@ -46,7 +46,7 @@
* @param {Object} uri
* @api public
*/
util.uniqueUri = function (uri) {
var protocol = uri.protocol
, host = uri.host
@@ -54,13 +54,12 @@
if ('undefined' != typeof document) {
host = host || document.domain;
port = port || document.location.port;
port = port || (protocol == 'https' ? 443 : document.location.port);
} else {
host = host || 'localhost';
}
return (protocol || 'http') + '://' + host + ':' +
(port || (protocol === 'https' ? 443 : 80));
return (protocol || 'http') + '://' + host + ':' + (port || 80);
};
/**