mirror of
https://github.com/Wessel/wumpfetch.git
synced 2026-07-18 22:33:56 +02:00
Small fixeroni
This commit is contained in:
@@ -151,8 +151,16 @@ module.exports = class WumpRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
req.on('error', (e) => reject(e));
|
req.on('error', (e) => reject(e));
|
||||||
if (this.o.data) req.write(this.o.SDA === 'json' ? JSON.stringify(this.o.data) : this.o.data);
|
if (this.o.SDA === 'json') {
|
||||||
|
req.write(JSON.stringify(this.o.data));
|
||||||
|
} else {
|
||||||
|
if (typeof this.o.data === 'object') {
|
||||||
|
req.write(JSON.stringify(this.o.data));
|
||||||
|
} else {
|
||||||
|
req.write(this.o.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
req.end();
|
req.end();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user