mirror of https://github.com/node-red/node-red.git
commit
97470e94f1
|
@ -637,6 +637,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
|||
msg.payload = msg.payload.toString('utf8'); // txt
|
||||
|
||||
if (node.ret === "obj") {
|
||||
if (msg.statusCode == 204){msg.payload= "{}"};
|
||||
try { msg.payload = JSON.parse(msg.payload); } // obj
|
||||
catch(e) { node.warn(RED._("httpin.errors.json-error")); }
|
||||
}
|
||||
|
|
|
@ -667,7 +667,7 @@ describe('HTTP Request Node', function() {
|
|||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
try {
|
||||
msg.should.have.property('payload','');
|
||||
msg.should.have.property('payload',{});
|
||||
msg.should.have.property('statusCode',204);
|
||||
done();
|
||||
} catch(err) {
|
||||
|
|
Loading…
Reference in New Issue