Fixed a fix

This commit is contained in:
Wessel T
2019-03-27 18:40:44 +01:00
parent 772b7923c2
commit 32ef89789a
2 changed files with 9 additions and 6 deletions

View File

@@ -151,13 +151,16 @@ module.exports = class WumpRequest {
} }
req.on('error', (e) => reject(e)); req.on('error', (e) => reject(e));
if (this.o.SDA === 'json') {
req.write(JSON.stringify(this.o.data)); if (this.o.data) {
} else { if (this.o.SDA === 'json') {
if (typeof this.o.data === 'object') {
req.write(JSON.stringify(this.o.data)); req.write(JSON.stringify(this.o.data));
} else { } else {
req.write(this.o.data); if (typeof this.o.data === 'object') {
req.write(JSON.stringify(this.o.data));
} else {
req.write(this.o.data);
}
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "wumpfetch", "name": "wumpfetch",
"version": "0.1.1", "version": "0.1.2",
"description": "🚀 A lightweight and fast Node.js HTTP Client", "description": "🚀 A lightweight and fast Node.js HTTP Client",
"author": "Wessel \"wesselgame\" T <discord@go2it.eu>", "author": "Wessel \"wesselgame\" T <discord@go2it.eu>",
"license": "MIT", "license": "MIT",