mirror of
https://github.com/Wessel/wumpfetch.git
synced 2026-06-08 14:10:03 +02:00
Update WumpResponse.js
This commit is contained in:
@@ -11,6 +11,11 @@ module.exports = class WumpResponse {
|
|||||||
this.body = Buffer.concat([ this.body, chunk ]);
|
this.body = Buffer.concat([ this.body, chunk ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parse () {
|
||||||
|
if (this.headers['content-type'] === 'application/json') return JSON.parse(this.body);
|
||||||
|
else return this.body.toString();
|
||||||
|
}
|
||||||
|
|
||||||
buffer () {
|
buffer () {
|
||||||
return this.body;
|
return this.body;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user