Browse Source

ws spoof issue

Michelle Bu 12 years ago
parent
commit
728b21278d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/server.js

+ 3 - 1
lib/server.js

@@ -96,7 +96,7 @@ PeerServer.prototype._initializeWSS = function() {
           case 'LEAVE':
             // Clean up if a Peer sends a LEAVE.
             if (!message.dst) {
-              self._removePeer(message.src);
+              self._removePeer(id);
               break;
             }
           // ICE candidates
@@ -106,6 +106,8 @@ PeerServer.prototype._initializeWSS = function() {
           case 'ANSWER':
           // Firefoxism (connectDataConnection ports)
           case 'PORT':
+            // Use the ID we know to be correct to prevent spoofing.
+            message.src = id;
             self._handleTransmission(message);
             break;
           default: