mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 11:36:58 +00:00
Pushover ttl Bug Fix (#1017)
* TTL Functionality Pick up msg.ttl and pass it to REST API, checking it is a positive integer first. * Update help doc Reference ttl parameter in api docs * Fix: Warnings with no ttl Check if ttl exists before sanitizing * Add: Allow string ttl If ttl is a string, parse to integer and check validity --------- Co-authored-by: Dave Conway-Jones <dceejay@users.noreply.github.com>
This commit is contained in:
parent
512697eec4
commit
a058999f4c
@ -63,10 +63,15 @@ module.exports = function(RED) {
|
||||
expire = 10800;
|
||||
node.warn("Expire time too high, using maximum setting of 10800s (3 hours) retry duration");
|
||||
}
|
||||
if (!Number.isInteger(ttl) || ttl<=0) {
|
||||
if (ttl !== null) {
|
||||
if(typeof ttl === "string") {
|
||||
ttl = parseInt(ttl);
|
||||
}
|
||||
if(isNaN(ttl) || !Number.isInteger(ttl) || ttl <= 0) {
|
||||
ttl = null;
|
||||
node.warn("No valid number for TTL found, not set");
|
||||
}
|
||||
}
|
||||
if (typeof msg.payload === 'undefined') { msg.payload = "(undefined msg.payload)"; }
|
||||
if (typeof(msg.payload) === 'object') {
|
||||
msg.payload = JSON.stringify(msg.payload);
|
||||
|
Loading…
x
Reference in New Issue
Block a user