mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 11:44:28 +08:00
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:
parent
5259fc151b
commit
38bb9a77e0
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user