Browse Source

default should be none to match message parsing

Michelle Bu 11 years ago
parent
commit
b452592eed
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lib/dataconnection.js

+ 4 - 4
lib/dataconnection.js

@@ -125,11 +125,9 @@ DataConnection.prototype.send = function(data) {
     return;
   }
   var self = this;
-  if (this.serialization === 'none') {
-    this._dc.send(data);
-  } else if (this.serialization === 'json') {
+  if (this.serialization === 'json') {
     this._dc.send(JSON.stringify(data));
-  } else {
+  } else if ('binary-utf8'.indexOf(this.serialization) !== -1) {
     var utf8 = (this.serialization === 'binary-utf8');
     var blob = util.pack(data, utf8);
     // DataChannel currently only supports strings.
@@ -140,6 +138,8 @@ DataConnection.prototype.send = function(data) {
     } else {
       this._dc.send(blob);
     }
+  } else {
+    this._dc.send(data);
   }
 }