Skip to content

Commit

Permalink
Merge branch 'patch-1' of github.com:ChALkeR/request
Browse files Browse the repository at this point in the history
  • Loading branch information
simov committed May 15, 2018
2 parents fb7aeb3 + 81f8cb5 commit db76838
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -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"
Expand Down
8 changes: 1 addition & 7 deletions request.js
Expand Up @@ -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')
Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit db76838

Please sign in to comment.