mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add guard against the http-request buffer fix being reverted
This commit is contained in:
parent
f54f863611
commit
0a6ff900da
@ -173,6 +173,12 @@ module.exports = function(RED) {
|
|||||||
|
|
||||||
// msg.url = url; // revert when warning above finally removed
|
// msg.url = url; // revert when warning above finally removed
|
||||||
res.on('data',function(chunk) {
|
res.on('data',function(chunk) {
|
||||||
|
if (!Buffer.isBuffer(chunk)) {
|
||||||
|
// if the 'setEncoding(null)' fix above stops working in
|
||||||
|
// a new Node.js release, throw a noisy error so we know
|
||||||
|
// about it.
|
||||||
|
throw new Error("HTTP Request data chunk not a Buffer");
|
||||||
|
}
|
||||||
msg.payload.push(chunk);
|
msg.payload.push(chunk);
|
||||||
});
|
});
|
||||||
res.on('end',function() {
|
res.on('end',function() {
|
||||||
@ -234,4 +240,3 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user