Permalink
Browse files

Move net.Socket.setEncoding changes to anologous function in tls module

  • Loading branch information...
1 parent fb2150f commit f68077cd920292aab5dcfc46e310ff2f924976c0 @Rush committed Jul 6, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/tls.js
View
@@ -183,7 +183,8 @@ CryptoStream.prototype.setKeepAlive = function(enable, initialDelay) {
CryptoStream.prototype.setEncoding = function(encoding) {
var StringDecoder = require('string_decoder').StringDecoder; // lazy load
- this._decoder = new StringDecoder(encoding);
+ // set encoding or revert encoding if none provided
+ this._decoder = encoding ? new StringDecoder(encoding) : null;
};

0 comments on commit f68077c

Please sign in to comment.