Try to parse json uri encoded strings in inputs

This commit is contained in:
lowlighter
2021-08-12 15:01:09 +02:00
parent 0d40bc6787
commit d52ae85660

View File

@@ -146,8 +146,13 @@ metadata.plugin = async function({__plugins, name, logger}) {
value = JSON.parse(value)
}
catch {
logger(`metrics/inputs > failed to parse json : ${value}`)
value = JSON.parse(defaulted)
try {
value = JSON.parse(decodeURIComponent(value))
}
catch {
logger(`metrics/inputs > failed to parse json : ${value}`)
value = JSON.parse(defaulted)
}
}
return value
}