2
0

🐛 (httpReq) Properly parse big ints

Closes #1486
This commit is contained in:
Baptiste Arnaud
2024-05-01 08:46:01 +02:00
parent aee006a14b
commit 7efb79d581
2 changed files with 30 additions and 1 deletions

View File

@@ -28,6 +28,7 @@ import {
} from '@typebot.io/schemas/features/blocks/integrations/webhook/constants'
import { env } from '@typebot.io/env'
import { parseAnswers } from '@typebot.io/results/parseAnswers'
import { JSONParse } from '@typebot.io/lib/JSONParse'
type ParsedWebhook = ExecutableHttpRequest & {
basicAuth: { username?: string; password?: string }
@@ -326,7 +327,7 @@ export const convertKeyValueTableToObject = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const safeJsonParse = (json: unknown): { data: any; isJson: boolean } => {
try {
return { data: JSON.parse(json as string), isJson: true }
return { data: JSONParse(json as string), isJson: true }
} catch (err) {
return { data: json, isJson: false }
}