Update WumpResponse.js

This commit is contained in:
2019-04-21 19:04:35 +02:00
committed by GitHub
parent 15b466106b
commit ba31773ca0

View File

@@ -11,6 +11,11 @@ module.exports = class WumpResponse {
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 () {
return this.body;
}