From 07b2771b63bfa700b5c8be55a076e6d3eb1dda80 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 18 Apr 2019 00:20:39 +0800 Subject: [PATCH] fix buffer encoding --- lib/utils/axios.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/utils/axios.js b/lib/utils/axios.js index c77c4d481a..23ce8008cf 100644 --- a/lib/utils/axios.js +++ b/lib/utils/axios.js @@ -56,6 +56,13 @@ const custom = got.extend({ return error; }, ], + beforeRequest: [ + (options) => { + if (options.responseType === 'buffer') { + options.encoding = null; + } + }, + ], }, agent: agent, headers: {