We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fd4eee commit 4804d0bCopy full SHA for 4804d0b
lib/index.js
@@ -316,7 +316,12 @@ NodeHttpXHR.prototype = Object.create(
316
case 'text':
317
return this._responseText;
318
case 'arraybuffer':
319
- return this._response;
+ case 'json':
320
+ if (this._response instanceof ArrayBuffer) {
321
+ return this._response;
322
+ } else if (this._response instanceof Buffer) {
323
+ return this._response.buffer;
324
+ }
325
default:
326
throw new Error('Assertion failed: unsupported response-type: ' + type);
327
}
0 commit comments