fix: sanitize JSON input in ParseData function to handle single quotes and parentheses (#8333)
* fix: sanitize JSON input in ParseData function to handle single quotes and parentheses * format code
This commit is contained in:
@@ -6,7 +6,9 @@ const logger = loggerService.withContext('URLSchema:handleProvidersProtocolUrl')
|
||||
|
||||
function ParseData(data: string) {
|
||||
try {
|
||||
const result = JSON.parse(Buffer.from(data, 'base64').toString('utf-8'))
|
||||
const result = JSON.parse(
|
||||
Buffer.from(data, 'base64').toString('utf-8').replaceAll("'", '"').replaceAll('(', '').replaceAll(')', '')
|
||||
)
|
||||
|
||||
return JSON.stringify(result)
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user