fix: got encoding

This commit is contained in:
DIYgod 2019-06-15 10:24:06 +08:00
parent 449cd6bf37
commit 59bb15e761
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
1 changed files with 3 additions and 0 deletions

View File

@ -75,6 +75,9 @@ const custom = got.extend({
if (options.data) {
options.body = options.body || options.data;
}
if (options.responseType === 'buffer') {
options.encoding = null;
}
if (options.params) {
options.query = options.query || queryString.stringify(options.params);
options.searchParams = options.query; // for Got v11 after