mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Simplified transport upgrade possibilities computation
This commit is contained in:
@@ -57,26 +57,17 @@ Server.prototype.__proto__ = EventEmitter.prototype;
|
||||
Server.prototype.clients;
|
||||
|
||||
/**
|
||||
* Returns a list of available transports for upgrade.
|
||||
* Returns a list of available transports for upgrade given a certain transport.
|
||||
*
|
||||
* @return {Array}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Server.prototype.upgrades = function () {
|
||||
var available = this.transports
|
||||
, upgrades = []
|
||||
|
||||
for (var i in transports) {
|
||||
if (~available.indexOf(i) && transports[i].prototype.isUpgrade) {
|
||||
upgrades.push(i);
|
||||
}
|
||||
}
|
||||
|
||||
return upgrades;
|
||||
Server.prototype.upgrades = function (transport) {
|
||||
if (!this.allowUpgrades) return [];
|
||||
return transports[transport].upgradesTo || [];
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Verifies a request.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user