diff --git a/index.js b/index.js index 4154ce317..3e31d1344 100644 --- a/index.js +++ b/index.js @@ -95,7 +95,9 @@ function got(url, opts, cb) { return; } - read(res, encoding, cb, response); + read(res, encoding, function (err, data) { + cb.call(null, err, data, response); + }); }).once('error', cb); if (opts.timeout) { diff --git a/package.json b/package.json index e69a84d19..c7c9aa0e7 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "is-stream": "^1.0.0", "object-assign": "^2.0.0", "prepend-http": "^1.0.0", - "read-all-stream": "^0.1.0", + "read-all-stream": "^1.0.0", "timed-out": "^2.0.0" }, "devDependencies": {