From 81f8cb57bbc9fed0533c268e6a0c94ec45d9da9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Sun, 4 Mar 2018 01:04:49 +0300 Subject: [PATCH] Remove redundant code That one was needed for Node.js 0.9.4 and below, which is not supported anymore. --- package.json | 1 - request.js | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) 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) } }