Skip to content

Commit 76a6e5b

Browse files
authored
Merge pull request #2885 from ChALkeR/patch-1
Remove redundant code (for Node.js 0.9.4 and below) and dependency
2 parents fb7aeb3 + db76838 commit 76a6e5b

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"performance-now": "^2.1.0",
4646
"qs": "~6.5.1",
4747
"safe-buffer": "^5.1.1",
48-
"stringstream": "~0.0.5",
4948
"tough-cookie": "~2.3.3",
5049
"tunnel-agent": "^0.6.0",
5150
"uuid": "^3.1.0"

request.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ var aws2 = require('aws-sign2')
1111
var aws4 = require('aws4')
1212
var httpSignature = require('http-signature')
1313
var mime = require('mime-types')
14-
var stringstream = require('stringstream')
1514
var caseless = require('caseless')
1615
var ForeverAgent = require('forever-agent')
1716
var FormData = require('form-data')
@@ -1049,13 +1048,8 @@ Request.prototype.onRequestResponse = function (response) {
10491048
if (self.encoding) {
10501049
if (self.dests.length !== 0) {
10511050
console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.')
1052-
} else if (responseContent.setEncoding) {
1053-
responseContent.setEncoding(self.encoding)
10541051
} else {
1055-
// Should only occur on node pre-v0.9.4 (joyent/node@9b5abe5) with
1056-
// zlib streams.
1057-
// If/When support for 0.9.4 is dropped, this should be unnecessary.
1058-
responseContent = responseContent.pipe(stringstream(self.encoding))
1052+
responseContent.setEncoding(self.encoding)
10591053
}
10601054
}
10611055

0 commit comments

Comments
 (0)