diff --git a/package.json b/package.json index 1c58f20aa..f00a1f86f 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "performance-now": "^2.1.0", "qs": "~6.5.1", "safe-buffer": "^5.1.1", - "stringstream": "~0.0.5", "tough-cookie": "~2.3.3", "tunnel-agent": "^0.6.0", "uuid": "^3.1.0" diff --git a/request.js b/request.js index ff19ca39c..c93258b3b 100644 --- a/request.js +++ b/request.js @@ -11,7 +11,6 @@ var aws2 = require('aws-sign2') var aws4 = require('aws4') var httpSignature = require('http-signature') var mime = require('mime-types') -var stringstream = require('stringstream') var caseless = require('caseless') var ForeverAgent = require('forever-agent') var FormData = require('form-data') @@ -1049,13 +1048,8 @@ Request.prototype.onRequestResponse = function (response) { if (self.encoding) { if (self.dests.length !== 0) { console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') - } else if (responseContent.setEncoding) { - responseContent.setEncoding(self.encoding) } else { - // Should only occur on node pre-v0.9.4 (joyent/node@9b5abe5) with - // zlib streams. - // If/When support for 0.9.4 is dropped, this should be unnecessary. - responseContent = responseContent.pipe(stringstream(self.encoding)) + responseContent.setEncoding(self.encoding) } }