From 5130d572d1b19cb8cfcb31905bad970c60d15550 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 28 Aug 2018 15:46:04 -0400 Subject: [PATCH 1/2] fix: make `nets` return `json` rather than `arraybuffer` --- src/WebHelper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/WebHelper.js b/src/WebHelper.js index 64319cfa..8196bc0b 100644 --- a/src/WebHelper.js +++ b/src/WebHelper.js @@ -155,7 +155,8 @@ class WebHelper extends Helper { } return nets(Object.assign({ body: data, - method: method + method: method, + encoding: undefined // eslint-disable-line no-undefined }, reqConfig), (err, resp, body) => { if (err || Math.floor(resp.statusCode / 100) !== 2) { return reject(err || resp.statusCode); From 8ef04329c8c10a6ea50d4caa47da60aef629d671 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 28 Aug 2018 15:46:34 -0400 Subject: [PATCH 2/2] fix: return asset id even for `put` requests --- src/WebHelper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebHelper.js b/src/WebHelper.js index 8196bc0b..c02ceed4 100644 --- a/src/WebHelper.js +++ b/src/WebHelper.js @@ -162,7 +162,7 @@ class WebHelper extends Helper { return reject(err || resp.statusCode); } return resolve(Object.assign({ - id: body['content-name'] + id: body['content-name'] || assetId }, body)); }); });