add try/catch block around JSON.parse, since user input can be incorrect formatted string
This commit is contained in:
parent
3029178eeb
commit
81b4f8f5d4
|
@ -92,7 +92,12 @@ module.exports.run = async function ({ inputs }) {
|
|||
}
|
||||
|
||||
if (headers && headers.length !== 0) {
|
||||
request.headers = { ...request.headers, ...JSON.parse(headers) }
|
||||
try {
|
||||
const customHeaders = JSON.parse(headers)
|
||||
request.headers = { ...request.headers, ...customHeaders }
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue