diff --git a/node_modules/thrift/protocol.js b/node_modules/thrift/protocol.js index 79dfdb7..b5e1ab8 100644 --- a/node_modules/thrift/protocol.js +++ b/node_modules/thrift/protocol.js @@ -123,16 +123,9 @@ TBinaryProtocol.prototype.writeDouble = function(dub) { this.trans.write(BinaryParser.fromDouble(dub)); } -TBinaryProtocol.prototype.writeString = function(arg) { - if (typeof(arg) === 'string') { - this.writeI32(Buffer.byteLength(arg, 'utf8')) - this.trans.write(arg, 'utf8'); - } else if (arg instanceof Buffer) { - this.writeI32(arg.length) - this.trans.write(arg); - } else { - throw new Error('writeString called without a string/Buffer argument: ' + arg) - } +TBinaryProtocol.prototype.writeString = function(str) { + this.writeI32(str.length); + this.trans.write(str); } TBinaryProtocol.prototype.readMessageBegin = function() {